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

查看:121
本文介绍了如何从非托管COM dll生成类型库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须使用第三方,非托管COM dll到我的.NET应用程序。我需要修改此程序集以生成自定义RCW 。为了编辑Interop程序集,我需要的类型库具体装配。可以任何一个解释我如何从非托管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.

谢谢你,
最好的问候,
Robo。

Thank you, Best Regards, Robo.

推荐答案

如果你想要做的是从本地dll(和本机DLL嵌入TLB作为资源)创建一个Interop程序集,你可以直接调用tlbimp直接在dll:

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

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天全站免登陆