将两个.IDL文件或两个.tlb文件合并为一个文件 [英] Merging two .IDL files or two .tlb files into one file

查看:138
本文介绍了将两个.IDL文件或两个.tlb文件合并为一个文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有2个.net dll,我使用REGASM暴露给COM.为了简化在COM客户端中的引用,我想将它们合并为一个文件.

I have 2 .net dll's which I expose to COM using REGASM. In order to simplify referencing within a COM client I would like to make these into one file.

我尝试将两个文件都转换为IDL,然后将一个文件的库"部分的内容复制到另一个文件中,然后使用MIDL编译回.tlb.这对于第二个IDL中的TypeDefs可以正常工作,但是当涉及到我复制的接口时,它似乎失败.OLE/COM查看器可以看到接口定义,但是当我尝试通过COM使用TLB时,找不到该接口我复制了.

I have tried converting both files to IDL and then copying the contents of the Library section of one into the other and then compiling back to .tlb with MIDL. This works fine for the TypeDefs within the second IDL however it seems to fail when it comes to the interfaces I copied in. OLE/COM viewer can see the interface definitions but when I try and use the TLB via COM it cant find the interfaces that I copied in.

我想确保在花太多时间之前,实际上可以通过这种方式来减少IDL.

I wanted to make sure before I spend too much time on this, that it is actually possible to meagre IDL's in this way.

推荐答案

好,结果证明我遇到的问题与合并idl无关.

Ok so it turns out that the issues I was experiencing were not related to merging the idl's.

如果您希望合并到idl,只需将一个idl中库部分的内容复制到另一个idl中即可.然后在合并的文件上运行midl,将其转换为tlb.

If you wish to merge to idl's you can do so by simply copying the content of a library section in one idl into another. Then run midl on the merged file to turn it into a tlb.

这篇关于将两个.IDL文件或两个.tlb文件合并为一个文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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