Export (0) Print
Expand All
7 out of 15 rated this helpful - Rate this topic

IClassFactory interface

Enables a class of objects to be created.

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 CoGetClassObject function to get an IClassFactory interface pointer to the class object, call the CreateInstance method of this interface to create an object.

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

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

Members

The IClassFactory interface inherits from the IUnknown interface. IClassFactory also has these types of members:

Methods

The IClassFactory interface has these methods.

MethodDescription
CreateInstance

Creates an uninitialized object.

LockServer

Locks an object application open in memory.

 

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps | Windows Store apps]

Minimum supported server

Windows 2000 Server [desktop apps | Windows Store apps]

Header

Unknwn.h

IDL

Unknwn.idl

IID

IID_IClassFactory is defined as 00000001-0000-0000-C000-000000000046

See also

CoCreateInstance
CoGetClassObject
OleCreate

 

 

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.