IClassFactory

The IClassFactory interface manages the creation of new objects. This interface is supported by class objects associated with CLSIDs.

When to Implement

You must implement this interface for every object definition so objects of that type can be created.

When to Use

Call the methods of this interface when creating new objects through a class object. First, call the CoGetClassObject API function to get an IClassFactory interface pointer to the class object, and then call the CreateInstance method to create an uninitialized object.

It is, however, not 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 OleCreateXxx) to create compound document objects.

Methods in Vtable Order

IUnknown Methods
Description
QueryInterface
Returns pointers to supported interfaces.
AddRef
Increments reference count.
Release
Decrements reference count.

IClassFactory Methods
Description
CreateInstance
Creates an uninitialized object.
LockServer
Locks object application open in memory.

See Also

CoGetClassObject, CoCreateInstance , OleCreate

Software for developers
Delphi Components
.Net Components
Software for Android Developers
More information resources
MegaDetailed.Net
Unix Manual Pages
Delphi Examples
Databases for Amazon shops developers
Amazon Categories Database
Browse Nodes Database