Click to Rate and Give Feedback
MSDN
MSDN Library
COM
COM Fundamentals
Reference
Functions
 CLSIDFromProgID Function

  Switch on low bandwidth view
CLSIDFromProgID Function

Looks up a CLSID in the registry, given a ProgID.

Syntax

C++
HRESULT CLSIDFromProgID(
  __in   LPCOLESTR lpszProgID,
  __out  LPCLSID lpclsid
);

Parameters

lpszProgID [in]

A pointer to the ProgID whose CLSID is requested.

lpclsid [out]

Receives a pointer to the retrieved CLSID on return.

Return Value

This function can return the following values.

Return codeDescription
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. See Remarks below.

 

Remarks

Given a ProgID, CLSIDFromProgID looks up its associated CLSID in the registry. If the ProgID cannot be found in the registry, CLSIDFromProgID creates an OLE 1 CLSID for the ProgID and a CLSID entry in the registry. Because of the restrictions placed on OLE 1 CLSID values, CLSIDFromProgID and CLSIDFromString are the only two functions that can be used to generate a CLSID for an OLE 1 object.

Requirements

Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderObjbase.h
LibraryOle32.lib
DLLOle32.dll

See Also

CLSIDFromProgIDEx
ProgIDFromCLSID

Send comments about this topic to Microsoft

Build date: 6/11/2009

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker