如何从非托管 COM dll 生成类型库 [英] How to generate type library from unmanaged COM dll

查看:16
本文介绍了如何从非托管 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 生成类型库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆