在COM DLL上使用tlbexp.exe [英] Using tlbexp.exe on a COM dll
问题描述
我正在尝试在 Centura 和COM .dll之间建立沟通。 (从 http://download.resip.fr 下载数据库导入)
I am trying to set up communication between Centura and a COM .dll. (Downloaded from http://download.resip.fr for a database import)
Centura需要.tlb文件才能与此组件通信。通常我会使用 regasm / tlb
来生成.tlb,但看到它是一个COM .dll这是不可能的。
Centura requires a .tlb file to be able to communicate to this component. Normally I would use regasm /tlb
to generate the .tlb but seeing as it is a COM .dll this is not possible.
我发现我可以使用tlbexp的.NET dll的: http://msdn.microsoft.com/en-us/library/hfzzah2c(v = vs80).aspx
I found that I could use tlbexp for .NET dll's: http://msdn.microsoft.com/en-us/library/hfzzah2c(v=vs.80).aspx
我试过这个,知道它可能会失败(因为我有COM .dll)。我收到这个错误:
I tried this out, knowing it would probably fail (as I have COM .dll). I received this error:
TlbExp:error TX0000:无法加载文件或程序集'file:/// C:\Windows\\ \\ system32\ResipBcb.dll或其依赖关系之一。该模块预计包含一个程序集清单。
TlbExp : error TX0000 : Could not load file or assembly 'file:///C:\Windows\system32\ResipBcb.dll' or one of its dependencies. The module was expected to contain an assembly manifest.
使用Dependency Walker我注意到两个.dll的缺失。我在网上找到了ieshims.dll,但是找不到wer.dll。请参阅此问题。
我不知道tlbexp失败是否与该文件丢失有关?
Using Dependency Walker I noticed two .dll's missing. I found ieshims.dll online but I can't find the wer.dll. See this question.
I don't know if the tlbexp failure has anything to do with this file that is missing?
总而言之,我的问题是:
如何我从这个.dll得到一个.tlb我似乎找不到任何方法从.COM中提取.tlb。
To sum up, my question is: How do I get a .tlb from this .dll? I can't seem to find any way to extract the .tlb out of this COM .dll.
最好的问候
Clint Cambier
Best regards
Clint Cambier
推荐答案
你想要做的只适用于.NET程序集,而不是本机COM服务器。它们的类型库几乎总是嵌入到DLL中。在Visual Studio中,使用File + Open + File并选择DLL。打开TYPELIB节点,右键单击资源(通常为1),导出。将其保存到项目目录中,使用.tlb文件扩展名。
What you are trying to do only works for .NET assemblies, not native COM servers. The type library for them is almost always embedded inside the DLL. In Visual Studio, use File + Open + File and select the DLL. Open the "TYPELIB" node, right-click the resource (usually 1), Export. Save it to, say, a project directory, use the .tlb filename extension.
这篇关于在COM DLL上使用tlbexp.exe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!