Get IDL code from TypeLibrary programmatically
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 Ole开发者_高级运维Viewer 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?
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
精彩评论