我正在尝试在 Centura 之间建立通信和一个 COM .dll。 (从 http://download.resip.fr 下载用于数据库导入)
Centura 需要一个 .tlb 文件才能与该组件通信。通常我会使用 regasm /tlb
生成 .tlb 但看到它是一个 COM .dll 这是不可能的。
我发现我可以将 tlbexp 用于 .NET dll:http://msdn.microsoft.com/en-us/library/hfzzah2c(v=vs.80).aspx
我试过了,知道它可能会失败(因为我有 COM .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。见 this question .
不知道tlbexp失败是否与这个文件丢失有关?
总结一下,我的问题是:
我如何从这个 .dll 获取 .tlb?我似乎找不到任何方法从这个 COM .dll 中提取 .tlb。
此致
克林特·坎比尔
最佳答案
您尝试执行的操作仅适用于 .NET 程序集,而不适用于 native COM 服务器。它们的类型库几乎总是嵌入在 DLL 中。在 Visual Studio 中,使用 File + Open + File 并选择 DLL。打开“TYPELIB”节点,右键点击资源(一般为1),导出。将其保存到项目目录,使用 .tlb 文件扩展名。
关于dll - 在 COM dll 上使用 tlbexp.exe,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4547313/