Reputation: 3009
I'm trying to get the IDL file for the type library of a complex ActiveX control created with VB6. I tried to do this with OleView.exe on my development pc with 64-bit Win10 Pro. The x64 version of OleView simply crashes when I try to open the OCX file or the TLB extracted from it. The x86 version shows me the following error box two times:
Perhaps, the TLB file has several importlib
directives and OleView can't find the referenced files. I could view the OCA file for the component in OleView, and its IDL equivalent contains these lines at the top:
// TLib : // TLib : Visual Basic objects and procedures : {FCFB3D2E-A0FA-1068-A738-08002B3371B5}
importlib("VB6.OLB");
// TLib : OLE Automation : {00020430-0000-0000-C000-000000000046}
importlib("stdole2.tlb");
// TLib : Visual Basic runtime objects and procedures : {EA544A21-C82D-11D1-A3E4-00A0C90AEA82}
importlib("3");
How to solve this problem with OleView? Or is there another tool to convert TLB to IDL?
Upvotes: 2
Views: 2501
Reputation: 1
I faced the same issue and it was because of two reasons
VB component's tlb was not registered. You need to run regtlib as administrator. After that oleview will open the tlb but with an error.
one of the tlb file that was referenced by VB component was not registered. In OLE view at the top, there will be an entry like below // TLib : ??filename : {000XXXXX-0000-0000-C000-000000000046} (some GUID)
??filename indicates that the tlb corresponding to the GUID is NOT registered. You need to figure out the tlb corresponding to that and run regtlib against the file name
Upvotes: 0
Reputation: 3009
I could convert the extended type library for my component stored in the OCA file into the corresponding IDL file using the OleWoo tool. However, the IDL I got is not correct in many places. It does not contain semicolons, etc. But at least, it can be used to get a general picture of the COM interfaces implemented in a component.
Upvotes: 0