Skip to content

Latest commit

 

History

History
120 lines (101 loc) · 3.63 KB

nf-combaseapi-cogettreatasclass.md

File metadata and controls

120 lines (101 loc) · 3.63 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:combaseapi.CoGetTreatAsClass
CoGetTreatAsClass function (combaseapi.h)
Returns the CLSID of an object that can emulate the specified object.
CoGetTreatAsClass
CoGetTreatAsClass function [COM]
_com_CoGetTreatAsClass
com.cogettreatasclass
combaseapi/CoGetTreatAsClass
com\cogettreatasclass.htm
com
f95fefe6-dc37-45f4-93be-87c996990ab9
12/05/2018
CoGetTreatAsClass, CoGetTreatAsClass function [COM], _com_CoGetTreatAsClass, com.cogettreatasclass, combaseapi/CoGetTreatAsClass
combaseapi.h
Objbase.h
Windows
Windows 2000 Professional [desktop apps only]
Windows 2000 Server [desktop apps only]
Ole32.lib
Ole32.dll
Windows
19H1
CoGetTreatAsClass
combaseapi/CoGetTreatAsClass
c++
APIRef
kbSyntax
DllExport
Ole32.dll
API-MS-Win-Core-Com-l1-1-0.dll
ComBase.dll
API-MS-Win-Core-Com-l1-1-1.dll
API-MS-Win-DownLevel-Ole32-l1-1-0.dll
API-MS-Win-DownLevel-Ole32-l1-1-1.dll
CoGetTreatAsClass

CoGetTreatAsClass function

-description

Returns the CLSID of an object that can emulate the specified object.

-parameters

-param clsidOld [in]

The CLSID of the object that can be emulated (treated as) an object with a different CLSID.

-param pClsidNew [out]

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.

-returns

This function can return the following values, as well as any error values returned by the CLSIDFromString function.

Return code Description
S_OK
A new CLSID was successfully returned.
S_FALSE
There is no emulation information for the clsidOld parameter, so the pClsidNew parameter is set to clsidOld.
REGDB_E_READREGDB
There was an error reading the registry.

-remarks

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).

-see-also

CoTreatAsClass