Retrieves the class identifier (CLSID) of the object.
HRESULT GetClassID( CLSID *pClassID );
A pointer to the location that receives the CLSID on return. The CLSID is a globally unique identifier (GUID) that uniquely represents an object class that defines the code that can manipulate the object's data.
If the method succeeds, the return value is S_OK. Otherwise, it is E_FAIL.
The GetClassID method retrieves the class identifier (CLSID) for an object, used in later operations to load object-specific code into the caller's context.OleSave helper function, which performs all the necessary steps. For this reason, most container applications have no need to call this method directly.
The exception would be a container that provides an object handler for certain objects. In particular, a container application should not get an object's CLSID and then use it to retrieve class specific information from the registry. Instead, the container should use IOleObject and IDataObject interfaces to retrieve such class-specific information directly from the object.TreatAs registry key has been set by an application that supports emulation (and so is treating the object as one of a different class), a call to GetClassID must supply the CLSID specified in the TreatAs key. For more information on emulation, see CoTreatAsClass.
When an object is in the running state, the default handler calls an implementation of GetClassID that delegates the call to the implementation in the object. When the object is not running, the default handler instead calls the ReadClassStg function to read the CLSID that is saved in the object's storage.
If you are writing a custom object handler for your object, you might want to simply delegate this method to the default handler implementation (see OleCreateDefaultHandler).
|Minimum supported client||Windows 2000 Professional [desktop apps only]|
|Minimum supported server||Windows 2000 Server [desktop apps only]|