Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在非托管代码中,我可以使用LoadTypeLib()获取ITypeLib*指针并使用它来查看类型库以查找它包含的接口。
LoadTypeLib()
ITypeLib*
C# 中有System.Runtime.InteropServices.ComTypes.ITypeLib接口,但我找不到LoadTypeLib()函数的等价物。
System.Runtime.InteropServices.ComTypes.ITypeLib
如何ITypeLib在 C# 中加载类型库并获取引用?
ITypeLib
直接从 System.Design.NativeMethods 复制而来,Reflector 很有用:
[DllImport("oleaut32.dll", PreserveSig=false)] public static extern ITypeLib LoadTypeLib([In, MarshalAs(UnmanagedType.LPWStr)] string typelib);