CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 1999
    Posts
    6

    To get CLSID of OCX from its file name.

    Hi,
    I have an oCX ( say abc.ocx ). How can I get cLSID for it ( Programmatically )
    I am using VC++. I have used GetClassFile which takes file name as [IN] parameter and gives clsid as [OUT] parameter, but it is failing.
    I do not want to use manaual effort of exploring registry using regedit.

    Thanks,
    Onkar






  2. #2
    Join Date
    May 1999
    Location
    Farnborough, Hants, England
    Posts
    710

    Re: To get CLSID of OCX from its file name.

    Does CLSIDFromProgID() (where the OCX filename is the 'ProgID') do the job? (I don't know, I'm just trying to suggest a possibility).



    --
    Jason Teagle
    [email protected]

  3. #3
    Join Date
    Apr 1999
    Posts
    37

    Re: To get CLSID of OCX from its file name.

    Onkar,
    do to want tofind the CLSID of the control contained in a OCX?A OCX can possibly contain many controls.So there is a possiblity that there might be many CLSID's ina single OCX.
    The function GetClassFile is meant for finding CLSID of OLE objects stored in a structured storage file.A OCX is not a structured storage file.
    So what you need to do is use the ITypeLib and ITypeInfo interfaces and LoadTypeLib.






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

Featured