110,539
社区成员
发帖
与我相关
我的任务
分享
[Guid("8640822D-ABC1-4709-A099-7FEE2F3F822D"), InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
public interface MyCom_Events
{
}
[Guid("8041CD87-F2FD-4F89-9051-5191662ECCB6"), ClassInterface(ClassInterfaceType.None), ComSourceInterfaces(typeof(MyCom_Events))]
public class Class1 : MyCom_Interface
{
public int Add(int a, int b)
{
return a + b;
}
}
[DllImport("MyInterop.dll")]
public static extern string ShowDialog();
[Guid("C0DF7BB2-6457-4125-B428-D6C66D666F1D")]
public interface IMyInterop
{
string ShowDialog();
}
[ClassInterface(ClassInterfaceType.None)]
[Guid("726FFB33-791C-419B-A506-1195E5429BAE")]
public class MyInterop : IMyInterop
{
public string ShowDialog()
{
return "ok";
}
}
黏贴错了,入魔了。。