COM Functions

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

The following table shows the COM functions with a description of the purpose of each.

Note

Windows Mobile may not support all of the programming elements in this section. For information about differences between the COM implementation available for Windows Mobile devices and that available for Windows Embedded CE devices, see COM and DCOM in Windows Mobile Devices.

Programming element Description

BindMoniker

This function locates an object by means of its moniker, activates the object if it is inactive, and retrieves a pointer to the specified interface on that object.

CLSIDFromProgID

This function looks up a class identifier in the registry, given a programmatic identifier.

CLSIDFromString

This function converts a string generated by the StringFromCLSID function back into the original class identifier.

CoAddRefServerProcess

This function increments a global per-process reference count.

CoBuildVersion

This function is obsolete.

CoCopyProxy

This function makes a private copy of the specified proxy.

CoCreateGuid

This function creates a GUID, a unique 128-bit integer used for CLSIDs and interface identifiers.

CoCreateInstance

This function creates on the local system a single uninitialized object of the class associated with a specified class identifier.

CoCreateInstanceEx

The function creates an instance of a specific class on a specific machine.

CoDisconnectObject

This function disconnects all remote process connections being maintained on behalf of all the interface pointers that point to a specified object

CoFileTimeNow

This function returns the current time as a FILETIME structure.

CoFreeAllLibraries

This function frees all the DLLs that have been loaded with the CoLoadLibrary function (called internally by CoGetClassObject), regardless of whether they are currently in use.

CoFreeLibrary

This function frees a library that, when loaded, was specified to be freed explicitly.

CoFreeUnusedLibraries

This function unloads any DLLs that are no longer in use and that, when loaded, were specified to be freed automatically.

CoGetCallContext

This function retrieves the context of the current call on the current thread.

CoGetClassObject

This function provides a pointer to an interface on a class object associated with a specified class identifier.

CoGetCurrentProcess

This function returns a value that is unique to the current thread.

CoGetInstanceFromFile

This function creates a new object and initializes it from a file using IPersistFile::Load.

CoGetInstanceFromIStorage

This function creates a new object and initializes it from a storage object through an internal call to IPersistStorage::Load.

CoGetInterfaceAndReleaseStream

This function unmarshals a buffer containing an interface pointer and releases the stream when an interface pointer has been marshaled from another thread to the calling thread.

CoGetMarshalSizeMax

This function returns an upper bound on the number of bytes needed to marshal the specified interface pointer to the specified object.

CoGetPSClsid

This function returns the CLSID of the DLL that implements the proxy and stub for the specified interface.

CoGetStandardMarshal

This function creates a default, or standard, marshaling object in either the client process or the server process, depending on the caller, and returns a pointer to that object's IMarshal implementation.

CoInitialize

This function initializes the COM library on the current thread and identifies the concurrency model as single-thread apartment (STA).

CoInitializeEx

This function initializes the Component Object Model (COM) for use by the current thread. Applications are required to use CoInitializeEx before they make any other COM library calls except for memory allocation functions.

CoInitializeSecurity

This function registers security and sets the default security values for the process.

CoLoadLibrary

This function is called internally by the CoGetClassObject, when the class context indicates a DLL, to load a specific DLL into the caller's process.

CoLockObjectExternal

This function is called either to lock an object to ensure that it stays in memory, or to release such a lock.

CoMarshalHresult

This function marshals an HRESULT to the specified stream, from which it can be unmarshaled using the CoUnmarshalHresult function.

CoMarshalInterface

This function writes into a stream the data required to initialize a proxy object in some client process.

CoMarshalInterThreadInterfaceInStream

This function marshals an interface pointer from one thread to another thread in the same process.

CoQueryAuthenticationServices

This function retrieves a list of the authentication services registered when the process called CoInitializeSecurity.

CoQueryClientBlanket

This function is called by the server to find out about the client that invoked the method executing on the current thread.

CoQueryProxyBlanket

This function retrieves the authentication information the client uses to make calls on the specified proxy.

CoRegisterClassObject

This function registers an EXE class object with OLE so other applications can connect to it.

CoRegisterMallocSpy

This function registers an implementation of the IMallocSpy interface in OLE, thereafter requiring OLE to call its wrapper methods around every call to the corresponding IMalloc method.

CoRegisterPSClsid

This function enables a downloaded DLL to register its custom interfaces within its running process so that the marshaling code will be able to marshal those interfaces.

CoRegisterSurrogate

This function registers the surrogate process through its ISurrogate interface pointer.

CoReleaseMarshalData

This function destroys a previously marshaled data packet.

CoReleaseServerProcess

This function decrements the global per-process reference count.

CoResumeClassObjects

This function is called by a server that can register multiple class objects to inform the OLE SCM about all registered classes, and permits activation requests for those class objects.

CoRevertToSelf

This function restores the authentication information on a thread of execution.

CoRevokeClassObject

This function informs OLE that a class object, previously registered with the CoRegisterClassObject function, is no longer available for use.

CoRevokeMallocSpy

This function revokes a registered IMallocSpy object.

CoSetProxyBlanket

This function sets the authentication information that will be used to make calls on the specified proxy.

CoSuspendClassObjects

This function prevents any new activation requests from the SCM on all class objects registered within the process.

CoSwitchCallContext

This function switches the call context object used by CoGetCallContext.

CoTaskMemAlloc

This function allocates a block of task memory.

CoTaskMemFree

This function frees a block of task memory previously allocated through a call to the CoTaskMemAlloc or CoTaskMemRealloc function.

CoTaskMemRealloc

This function changes the size of a previously allocated block of task memory.

CoTreatAsClass

This function establishes or removes an emulation, in which objects of one class are treated as objects of a different class.

CoUninitialize

This function closes the OLE Component Object Model (COM) library, freeing any resources that it maintains.

CoUnmarshalHresult

This function unmarshals an HRESULT type from the specified stream.

CoUnmarshalInterface

This function initializes a newly created proxy using data written into the stream by a previous call to the CoMarshalInterface function, and returns an interface pointer to that proxy.

CreateAntiMoniker

This function creates and supplies a new anti-moniker.

CreateBindCtx

This function supplies a pointer to an implementation of IBindCtx, an object that stores information about a particular moniker-binding operation.

CreateClassMoniker

This function creates a class moniker that refers to the given class.

CreateFileMoniker

This function creates a file moniker based on the specified path.

CreateGenericComposite

This function performs a generic composition of two monikers and supplies a pointer to the resulting composite moniker.

CreateItemMoniker

This function creates an item moniker that identifies an object within a containing object (typically a compound document).

CreatePointerMoniker

This function creates a pointer moniker based on a pointer to an object.

DllCanUnloadNow

This function determines whether the dynamic-link library (DLL) that implements this function is in use.

DllGetClassObject

This function retrieves the class object from a DLL object handler or object application.

DllRegisterServer

This function instructs an in-process server to create its registry entries for all classes supported in this server module.

DllUnregisterServer

This function instructs an in-process server to remove only those entries created through DllRegisterServer.

GetClassFile

This function supplies the class identifier associated with the specified file name.

GetRunningObjectTable

Supplies a pointer to the IRunningObjectTable interface on the local Running Object Table (ROT).

IIDFromString

This function converts a string generated by the StringFromIID function back into the original interface identifier (IID).

IsEqualGUID

This function determines whether two GUIDs are equal.

IsValidIid

This function is obsolete.

IsValidInterface

This function is obsolete.

IsValidPtrIn

This function is obsolete.

IsValidPtrOut

This function is obsolete.

MkParseDisplayName

This function converts a string into a moniker that identifies the object named by the string.

MonikerCommonPrefixWith

This function creates a new moniker based on the common prefix that this moniker (the one comprising the data of this moniker object) shares with another moniker.

MonikerRelativePathTo

This function provides a moniker that, when composed onto the end of the first specified moniker (or one with a similar structure), yields the second specified moniker.

ProgIDFromCLSID

This function retrieves the ProgID for a given CLSID.

StringFromCLSID

This function converts a class identifier into a string of printable characters.

StringFromGUID2

This function converts a globally unique identifier (GUID) into a string of printable characters.

StringFromIID

This function converts an interface identifier into a string of printable characters.

UpdateDCOMSettings

This function updates the DCOM configuration after modifying the registry settings.

See Also

Reference

COM Reference