摘要:
1.添加安全接口2.安全接口源代码namespace WindowsControlLibrary1{ [ComImport, GuidAttribute("CB5BDC81-93C1-11CF-8F20-00805F2CD064")] [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)] public interface IObjectSafety { [PreserveSig] int GetInterfaceSafetyOptions(ref Guid riid, ... 阅读全文
摘要:
步骤1:新建工程第二步:勾选Make assembly com-visible第三步:勾选Register for com interop第四步:定义接口,注意接口的属性需要为public。(右键工程,添加一个接口Item即可)using System;using System.Collections.Generic;using System.Text;using System.Runtime.InteropServices;namespace WindowsControlLibrary1{ [ComVisible(true)] [Guid("C2918110-A1C4-4188-. 阅读全文