RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
ComObj.ProgIDToClassID Function

Returns the class ID (CLSID) GUID that corresponds to the string specified as the ProgID parameter.

Pascal
function ProgIDToClassID(const ProgID: string): TGUID;
C++
TGUID ProgIDToClassID(const AnsiString ProgID);

ProgIDToClassID retrieves, from the registry, the CLSID for a given programmatic ID. The ProgID parameter specifies the programmatic ID for which the CLSID is requested. A programmatic ID is a string that is associated with the CLSID in the registry. 

If ProgIDToClassID succeeds it returns the requested CLSID. If ProgIDToClassID fails an EOleSysError exception is raised with an error code indicating the cause of the error. The error code possibilities are as follows:

Error code 
Meaning 
CO_E_CLASSSTRING  
The registered CLSID for the ProgID is invalid.  
REGDB_E_WRITEREGDB  
An error occurred writing the CLSID to the registry.  

Note: If the ProgID cannot be found in the registry, ProgIDToClassID creates an OLE 1 CLSID for the ProgID and a CLSID entry in the registry.
 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!