This documentation is archived and is not being maintained.

Registering OLE Controls

OLE controls, like other OLE server objects, can be accessed by other OLE-aware applications. This is achieved by registering the control's type library and class.

The following functions allow you to add and remove the control's class, property pages, and type library in the Windows registration database:

Registering OLE Controls

AfxOleRegisterControlClass Adds the control's class to the registration database.
AfxOleRegisterPropertyPageClass Adds a control property page to the registration database.
AfxOleRegisterTypeLib Adds the control's type library to the registration database.
AfxOleUnregisterClass Removes a control class or a property page class from the registration database.
AfxOleUnregisterTypeLib Removes the control's type library from the registration database.

AfxOleRegisterTypeLib is typically called in a control DLL's implementation of DllRegisterServer. Similarly, AfxOleUnregisterTypeLib is called by DllUnregisterServer. AfxOleRegisterControlClass, AfxOleRegisterPropertyPageClass, and AfxOleUnregisterClass are typically called by the UpdateRegistry member function of a control's class factory or property page.

See Also

MFC Macros and Globals