Export (0) Print
Expand All
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

CoGetTreatAsClass

Windows Mobile 6.5
A version of this page is also available for
4/8/2010

This function returns the CLSID of an object that can emulate the specified object.


HRESULT CoGetTreatAsClass(
  REFCLSID clsidOld,
  LPCLSID pclsidNew
);

clsidOld

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

pclsidNew

[out] 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.

S_OK

A new CLSID was successfully returned.

S_FALSE

No emulation information for the clsidOld parameter and that the pclsidNew parameter is set to clsidOld.

REGDB_E_READREGDB

An error reading the registry.

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 specified object, this function returns the CLSID of the original object (clsidOld).

To determine whether the platform supports this function, see Determining Supported COM APIs.

Headerobjbase.h
Libraryole32.lib
Windows Embedded CEWindows CE 3.0 and later
Windows MobileWindows Mobile Version 5.0 and later

Community Additions

Show:
© 2014 Microsoft