Microsoft Windows CE 3.0  

IClassFactory:IUnknown

Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

Because this interface contains two methods intended to deal with an entire class of objects, it is implemented on the class object for a specific class of objects, identified by a class identifier (CLSID).

Method Description
IClassFactory::CreateInstance Creates an uninitialized object of a specified class identifier (CLSID).
IClassFactory::LockServer Locks an object application open in memory. This allows new objects to be created more quickly.

When to Implement

You must implement this interface for every class that you register in the system registry and to which you assign a CLSID, so objects of that class can be created.

When to Use

After calling the CoGetClassObjectfunction to get an IClassFactoryinterface pointer to the class object, call the CreateInstancemethod of this interface to create a new uninitialized object.

It is not, however, always necessary to go through this process to create an object. To create a single uninitialized object, you can, instead, just call CoCreateInstance. OLE also provides numerous helper functions (with names of the form OleCreate Xxx) to create compound document objects.

Call the LockServermethod to keep the object server in memory and enhance performance only if you intend to create more than one object of the specified class.

Requirements

Runs On Versions Defined in Include Link to
Windows CE OS 2.0 and later Objbase.h    
Note   This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.

See Also

CoCreateInstance, CoGetClassObject, IClassFactory, IClassFactory::CreateInstance, IClassFactory::LockServer