以编程方式从 TypeLibrary 获取 IDL 代码
我正在编写代码来执行以下步骤;
注册 .net .dll 并使用 regasm.exe 生成 .tlb
- 注册 .net .dll 并使用 regasm.exe 生成 .tlb
- 从 typeLibrary 生成 IDL 代码并将其存储在文件中。
- 编辑 IDL 代码,进行细微更改。
- 使用 Midl.exe 将 IDL 重新编译为 .tlb。
我相信您已经猜到了,我所坚持的步骤是 IDL 的生成。我知道这可以通过使用 Windows API 附带的 OleViewer 手动完成,但我想删除此手动步骤。
我似乎无法找到通过命令行操作 OleViewer 或找到任何其他生成 IDL 代码的方法。
有人有什么想法吗?我知道生成 IDL 的代码必须位于 OleViewer 中的某个位置...也许有办法访问它?
I am writing code to perform the following steps;
Register a .net .dll and generate a .tlb using regasm.exe
- Register a .net .dll and generate a .tlb using regasm.exe
- Generate the IDL code from the typeLibrary and store it in a file.
- Edit the IDL code making minor changes.
- Recompile the IDL into a .tlb using Midl.exe.
The step I am stuck on, as I am sure you have guessed, is the generation of the IDL. I know this can be done manually by using the OleViewer that comes with the Windows API, however I would like to remove this manual step.
I cant seem to find anyway to operate the OleViewer via command line or find any other method of generating the IDL code.
Anybody got any ideas? I know the code to generate the IDL must be in the OleViewer somewhere... perhaps there is a way to access it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Wine 有一个 oleview http://source 的开源实现
。 winehq.org/git/wine.git/tree/HEAD:/programs/oleview
也许你可以使用 typelib.c 中的 idl 枚举函数
http://source.winehq.org/git/ wine.git/blob/HEAD:/programs/oleview/typelib.c
Wine has an open source implementation of oleview
http://source.winehq.org/git/wine.git/tree/HEAD:/programs/oleview
Perhaps you'd be able to use the idl enumeration functions in typelib.c
http://source.winehq.org/git/wine.git/blob/HEAD:/programs/oleview/typelib.c