Events
May 19, 6 PM - May 23, 12 AM
Calling all developers, creators, and AI innovators to join us in Seattle @Microsoft Build May 19-22.
Register todayThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Returns the CLSID of an object that can emulate the specified object.
HRESULT CoGetTreatAsClass(
[in] REFCLSID clsidOld,
[out] LPCLSID pClsidNew
);
[in] clsidOld
The CLSID of the object that can be emulated (treated as) an object with a different CLSID.
[out] pClsidNew
A pointer to where the CLSID that can emulate clsidOld objects is retrieved. This parameter cannot be NULL. If there is no emulation information for clsidOld objects, the clsidOld parameter is supplied.
This function can return the following values, as well as any error values returned by the CLSIDFromString function.
Return code | Description |
---|---|
|
A new CLSID was successfully returned. |
|
There is no emulation information for the clsidOld parameter, so the pClsidNew parameter is set to clsidOld. |
|
There was an error reading the registry. |
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 specified object, this function returns the CLSID of the original object (clsidOld).
Requirement | Value |
---|---|
Minimum supported client | Windows 2000 Professional [desktop apps only] |
Minimum supported server | Windows 2000 Server [desktop apps only] |
Target Platform | Windows |
Header | combaseapi.h (include Objbase.h) |
Library | Ole32.lib |
DLL | Ole32.dll |
Events
May 19, 6 PM - May 23, 12 AM
Calling all developers, creators, and AI innovators to join us in Seattle @Microsoft Build May 19-22.
Register today