Returns the CLSID of an object that can emulate the specified object.
HRESULT CoGetTreatAsClass(
REFCLSID clsidOld, //CLSID of object that is being emulated
LPCLSID pclsidNew //Pointer to CLSID for object that can
// emulate clsidOld
);
This function can also return any of the error values returned by the CLSIDFromString function.
CoGetTreatAsClass returns the TreatAs entry in the registry for the specified object. The TreatAs entry, if set, is the CLSID of a registered object (an application) that can emulate the object in question. The TreatAs entry is set through a call to the CoTreatAsClass function. Emulation allows an application to open and edit an object of a different format, while retaining the original format of the object. Objects of the original CLSID are activated and treated as objects of the second CLSID. When the object is saved, this may result in loss of edits not supported by the original format. If there is no TreatAs entry for the specfied object, this function returns the CLSID of the original object (clsidOld).
Windows NT: Use version 3.1 or later.
Windows: Use Windows 95 or later.
Windows CE: Unsupported.
Header: Declared in objbase.h.
Import Library: Included as a resource in ole32.dll.