Share via


Prepare Your MFC ActiveX Control Program for Use

OverviewDetails

To prepare an MFC ActiveX Control program for use

  1. Compile and link the ActiveX (formerly OLE) Control starter files.

  2. Add code to the MFC ActiveX ControlWizard starter files.

Note   The build process automatically registers an ActiveX control in the registry. But you can use the following procedure to manually register an ActiveX control in the registry if needed.

To manually register an MFC ActiveX Control

  1. On the Tools menu, click Register Control.

Registering a control adds the following information to the Registration Database:

  • The text name of the control

  • The class name of the control

  • An indicator stating that the control conforms to the MFC ActiveX control protocols

  • The path of the control’s executable

  • The path and resource ID of the control palette bitmap

  • An indication of whether the control is insertable

  • The IDispatch IDs of the control’s properties and events interfaces

Controls built with the MFC ActiveX control classes are self-registering because two entry points in the control’s executable, DLLRegisterServer and DLLUnregisterServer, are automatically added when ControlWizard creates the control’s files. As their names imply, DLLRegisterServer and DLLUnregisterServer respectively add and remove the control’s registration information in the registry.

What do you want to know more about?