Results 1 to 5 of 5

Thread: Extracting CLSID progammatically from OCX?

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2003
    Posts
    9

    Extracting CLSID progammatically from OCX?

    Hi,

    I've spent a couple of hours googling, but can't find a way to extract the CLSID from an OCX file. I know I can register it and read this information (and others) from the Registry, but I'd like to get this information directly from the OCX instead, and display this info in a label.

    While browsing through Usenet and the Web, I happened upon a bit of infos on a MS-created by unsupported "tlbinf32.dll", but no code to show how to read the CLSID info.

    Anybody has some running code for VB5 or 6?

    Thank you :-)
    Fred.

  2. #2
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    Try
    VB Code:
    1. Private Sub Form_Load()
    2. Dim tlii As TLI.TypeLibInfo
    3.  
    4.     Set tlii = TLIApplication.TypeLibInfoFromFile("SomeFile.ocx")
    5.    
    6.     MsgBox tlii.Guid
    7.    
    8. End Sub
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  3. #3

    Thread Starter
    New Member
    Join Date
    Nov 2003
    Posts
    9
    Thx a bunch but where can I find the variable definition?

    >>Dim tlii As TLI.TypeLibInfo

    "User-defined type not found."

    Thx
    Fred.

  4. #4
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    Oh, sorry, you need to add a reference to the TypeLib Info Library.
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  5. #5

    Thread Starter
    New Member
    Join Date
    Nov 2003
    Posts
    9
    Thx :-) That did it.

    Fred.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width