How to generate type library from unmanaged COM dll(如何从非托管 COM dll 生成类型库)
问题描述
我必须在我的 .NET 应用程序中使用第三方非托管 COM dll.我需要修改此程序集以生成 自定义 RCW.为了编辑互操作程序集我需要特定程序集的类型库.谁能解释一下如何从非托管 COM dll 生成类型库?
I have to use third party, unmanaged COM dll into my .NET application. I need to modify this assembly to produce a custom RCW. In order to Edit Interop Assembly I need the type library of the particular assembly. Can any one explain me that how to How to generate type library from unmanaged COM dll?
regsvr32中没有生成类型库的选项.
There is no option in regsvr32 to generate type library.
谢谢你,最好的祝福,机器人.
Thank you, Best Regards, Robo.
推荐答案
如果您要做的只是从本机 dll 创建一个互操作程序集(并且本机 DLL 将 TLB 作为资源嵌入),您可以直接在 dll 上调用 tlbimp:
If all you're trying to do is create an Interop Assembly from a native dll (and the native DLL embeds the TLB as a resource), you can just call tlbimp directly on the dll:
tlbimp Foo.dll/out:Interop.Foo.dll
这将生成 Interop.Foo.dll.然后可以使用 ildasm 来修改 IL:
Which will generate Interop.Foo.dll. You can then use ildasm to modify the IL:
ildasm Interop.Foo.dll /out=Foo.il
这篇关于如何从非托管 COM dll 生成类型库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何从非托管 COM dll 生成类型库
基础教程推荐
- 为什么 RegOpenKeyEx() 在 Vista 64 位上返回错误代码 2021-01-01
- 初始化列表*参数*评估顺序 2021-01-01
- 我应该对 C++ 中的成员变量和函数参数使用相同的名称吗? 2021-01-01
- 如果我为无符号变量分配负值会发生什么? 2022-01-01
- 通过引用传递 C++ 迭代器有什么问题? 2022-01-01
- 非静态 const 成员,不能使用默认赋值运算符 2022-10-09
- GDB 显示调用堆栈上函数地址的当前编译二进制文 2022-09-05
- 为什么 typeid.name() 使用 GCC 返回奇怪的字符以及如 2022-09-16
- CString 到 char* 2021-01-01
- 为什么派生模板类不能访问基模板类的标识符? 2021-01-01
