Udostępnij za pośrednictwem


Class Factories and Licensing

To create an instance of your OLE control, a container application calls a member function of the control's class factory. Because your control is an actual OLE object, the class factory is responsible for creating instances of your control. Every OLE control class must have a class factory.

Another important feature of OLE controls is their ability to enforce a license. ControlWizard allows you to incorporate licensing during the creation of your control project. For more information on control licensing, see the article ActiveX Controls: Licensing An ActiveX Control.

The following table lists several macros and functions used to declare and implement your control's class factory and to license of your control.

Class Factories and Licensing

DECLARE_OLECREATE_EX

Declares the class factory for an OLE control or property page.

IMPLEMENT_OLECREATE_EX

Implements the control's GetClassID function and declares an instance of the class factory.

BEGIN_OLEFACTORY

Begins the declaration of any licensing functions.

END_OLEFACTORY

Ends the declaration of any licensing functions.

AfxVerifyLicFile

Verifies whether a control is licensed for use on a particular computer.

See Also

Concepts

MFC Macros and Globals