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 生成类型库


基础教程推荐
- 在 C++ 中计算滚动/移动平均值 2021-01-01
- 静态库、静态链接动态库和动态链接动态库的 .lib 文件里面是什么? 2021-01-01
- C++结构和函数声明。为什么它不能编译? 2022-11-07
- 我有静态或动态 boost 库吗? 2021-01-01
- 常量变量在标题中不起作用 2021-01-01
- 如何检查GTK+3.0中的小部件类型? 2022-11-30
- 如何在 C++ 中初始化静态常量成员? 2022-01-01
- 如何通过C程序打开命令提示符Cmd 2022-12-09
- 这个宏可以转换成函数吗? 2022-01-01
- 如何将 std::pair 的排序 std::list 转换为 std::map 2022-01-01