# Self Registration for Controls

ActiveX controls must support self-registration by implementing the DllRegisterServer and DllUnregisterServer functions. ActiveX controls must register all of the standard registry entries for embeddable objects and automation servers.

ActiveX Controls must use the component categories API to register themselves as a control and register the component categories that they require a host to support and any categories that the control implements, see the Component Categories section of this appendix. In addition an ActiveX Control may wish to register the control keyword in order to allow older control containers such as VB4 to host them.

ActiveX Controls should also register the ToolBoxBitmap32 registry key, although this is not mandatory.

The Insertable component category should only be registered if the control is suitable for use as a compound document object. It is important to note that a compound document object must support certain interfaces beyond the minimum IUnknown required for an ActiveX Control. Although an ActiveX Control may qualify as a compound document object, the control’s documentation should clearly state what behavior to expect under these circumstances.