Adding ActiveX Editing Controls to the Property Inspector

To allow the Property Inspector to host your custom ActiveX editing control, you implement the IAcPiPropertyEditControl interface and expose the IAcPiPropertyEditEventsSink interface as a connection point. The IAcPiPropertyEditControl interface enables one-way communication from the Property Inspector to your control. The Property Inspector forwards IDispatch pointers for selected objects and their properties. Your ActiveX control uses this information to get and set the objects' property data. The IAcPiPropertyEditControl interface also provides properties that manage your control's display.

Your control sends communications to its Property Inspector host through the outgoing IAcPiPropertyEditEventsSink interface. This interface handles mouse and keyboard event notifications. These events are fired through the COM connection point mechanism.

Each property that exposes a custom control also must implement the IAcPiPropertyDisplay interface and its GetCustomPropertyCtrl() method. This is done most easily by deriving from the IAcPiPropertyDisplayImpl template class and declaring a per-property display map, as described in the Per-Property Customization in the Property Inspector section. For example, if your control has been assigned the PROG ID PROGID_MYCONTROL, you could use the following macro call:

PROP_DISP_ENTRY(DISP_MYPROP, PROGID_MYCONTROL, NULL, NULL, NULL, 
NULL, 0x000000ff, FALSE, 0, 0)

Note that the DISP ID (DISP_MYPROP in the preceding example) must match the DISP ID passed to the OPMPROP_ENTRY macro call for the property that uses this control. This match establishes the custom control as the editor for this property.