CreateComControl - cCJMenuItem
Creates the COM control. This is called as part of the commandbar system activation process
Type: Function
Return Data Type: Variant
Parameters
| Parameter | Type | Description |
|---|---|---|
| hoControls | Handle | Proxy cCJCommandBarControls object, which is a collection of all controls for the parent object |
Syntax
Function CreateComControl Handle hoControls Returns Variant
Call Example
Get CreateComControl hoControls to VariantVariable
Description
CreateComControl is the message that creates the COM control for this object.
This is sent as part of the commandbar system activation sequence. The cCJCommandbarSystem object creates all child COM objects when it is activated. See CreateCommandBars for a description of this process. The cCJCommandbarSystem sends the message CreateComInstance to all child objects (menubars, toolbars, statusbars). These objects send the same message, CreateComInstance, to all of their child objects (menu items). When a cCJMeniItem object receives CreateComInstance it sends CreateComAction, which creates the COM action object and then sends CreateComControl to create the COM control.
CreateComControl does the following:
-
It creates the COM control and adds it to the parent's collection of menu items (using the passed hoControls cCJCommandBarControls object).
-
It assigns all DataFlex properties (e.g. peControlType, peControlStyle) to their COM counterparts (e.g. ComType, ComStyle).
-
It creates a DataFlex proxy object and binds it to the new control.
-
It calls OnCreateControl passing the proxy object. This is the event that can be used to support any control customization.
-
It destroys the proxy object.
| Col 1 | Col 2 |
|---|---|
| Note: | When this method is complete, the COM object is no longer bound to a proxy object. In particular, note that this cCJMenuItem object is not a proxy object for the COM control associated with the item. It is a proxy object for the COM action associated with the item. If you later need to send messages to the COM control you must create a new proxy object, bind it, use it, and destroy it. The method CreateProxyControl can be used for this purpose. |
You will rarely augment CreateComControl as OnCreateControl can handle most of your needs. You will also rarely call this message.