How from ProgID to CLSID


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: How from ProgID to CLSID

  1. #1
    Tom Guest

    How from ProgID to CLSID


    Hi, folks:

    In C++ COM programming, we normally need to import a .tlb file to use COM
    components that other people build. However, I could not get a .tlb file
    for a DLL file made from VB. How can I get around it? Specifically, How can
    I get CLSID from ProgID?

    Thanks in advance.

    Tom

  2. #2
    Rick Zhang Guest

    Re: How from ProgID to CLSID


    "Tom" <homer777@hotmail.com> wrote:
    >
    >Hi, folks:
    >
    >In C++ COM programming, we normally need to import a .tlb file to use COM
    >components that other people build. However, I could not get a .tlb file
    >for a DLL file made from VB. How can I get around it? Specifically, How

    can
    >I get CLSID from ProgID?
    >
    >Thanks in advance.
    >
    >Tom


    You can use the Functio -- CLSIDFromProgID
    CLSIDFromProgID
    Looks up a CLSID in the registry, given a ProgID.

    HRESULT CLSIDFromProgID(
    LPCOLESTR lpszProgID, //Pointer to the ProgID
    LPCLSID pclsid //Pointer to the CLSID
    );
    Parameters
    lpszProgID
    [in] Pointer to the ProgID whose CLSID is requested.
    pclsid
    [out] Pointer to the retrieved CLSID on return.
    Return Values
    S_OK
    The CLSID was retrieved successfully.
    CO_E_CLASSSTRING
    The registered CLSID for the ProgID is invalid.
    REGDB_E_WRITEREGDB
    An error occurred writing the CLSID to the registry.

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