System.Win.ComObj.ProgIDToClassID
Delphi
function ProgIDToClassID(const ProgID: string): TGUID;
C++
extern DELPHI_PACKAGE GUID __fastcall ProgIDToClassID(const System::UnicodeString ProgID);
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
function | public | System.Win.ComObj.pas System.Win.ComObj.hpp |
System.Win.ComObj | System.Win.ComObj |
Description
Returns the class ID (CLSID) GUID that corresponds to the string specified as the ProgID parameter.
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.