SuperBug

博客园 首页 联系 订阅 管理

2012年6月13日

摘要: 1.添加安全接口2.安全接口源代码namespace WindowsControlLibrary1{ [ComImport, GuidAttribute("CB5BDC81-93C1-11CF-8F20-00805F2CD064")] [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)] public interface IObjectSafety { [PreserveSig] int GetInterfaceSafetyOptions(ref Guid riid, ... 阅读全文
posted @ 2012-06-13 18:43 SuperBug 阅读(878) 评论(0) 推荐(0) 编辑

摘要: 步骤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-. 阅读全文
posted @ 2012-06-13 01:18 SuperBug 阅读(1599) 评论(0) 推荐(0) 编辑