find referenced libraries in typelib in VB


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: find referenced libraries in typelib in VB

  1. #1
    Luther Guest

    find referenced libraries in typelib in VB

    I am attempting to create a VB program that creates IDL source from an
    existing typelib (e.g., a DLL compiled by VB).

    I am having trouble determining which importlib() statements are required.

    I am using the TypeLibInfo COM objects (TlbInf32.dll -- help file and some
    samples are available on MSDN to download).

    OLEView can determine the referenced libraries, but the sample source code
    version predates that and the code is not included, so I can't see what they
    are doing ;-(

    I'm guessing that I have to enumerate through all TypeInfos, their
    interfaces, and all the parameters of their memebers, and grow a list of
    types I find that are not standard. But how do I get from that information
    to the name of the file for an importlib statement?

    E.g., I find an Interface IDispatch with GUID
    {00020400-0000-0000-C000-000000000046}, but how do Iget from this
    information to "stdole2.tlb"?




  2. #2
    Eduardo A. Morcillo Guest

    Re: find referenced libraries in typelib in VB

    > I am attempting to create a VB program that creates IDL source from an
    > existing typelib (e.g., a DLL compiled by VB).


    I did a type library decompiler using the ITypeInfo and ITypeLib interfaces
    (it's included with the olelib.tlb in my site).

    With the tlbinf32 you should check for external types
    (VarTypeInfo.IsExternalType). If the type is external, then it is defined in
    another type library. Using VarTypeInfo.TypeLibInfoExternal you get a
    reference to that type library, then just call ContainingFile to get the
    type library file name.

    --
    Eduardo A. Morcillo
    http://www.domaindlx.com/e_morcillo



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center