Skip to content

CreateComAction - cCJAction

Creates the COM action. This is called as part of the commandbar system activation process

Type: Procedure

Syntax

Procedure CreateComAction

Call Example

Send CreateComAction

Description

CreateComAction is the message that creates the COM action for this object. Once created this COM object is bound to this proxy object so that COM messages can be sent to 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 cCJAction or cCJMenuItem object receives CreateComInstance it sends CreateComAction, which creates the COM action object.

While it is possible to instantiate objects based on the cCJAction class, it is usually treated as an abstract class. Objects are usually based on its sub-class, the cCJMenuItem class. The cCJMenuItem's CreateComInstance message first calls CreateComAction (to create the action) and then calls CreateComControl (to create the control).

CreateComAction does the following:

  1. If the action ID, piID, has not been assigned it will do so (normally this is assigned in End_Construct_Object).

  2. It assigns all DataFlex properties (e.g. psCaption) to their COM counterparts (e.g. ComCaption).

  3. It calls OnCreateAction. This is the event that can be used to support any action customization.

You will rarely augment CreateComAction as OnCreateAction can handle most of your needs. You will also rarely call this message. You may use it if you are creating dynamic, standalone action objects (i.e., actions without a control), but this would not be normal usage.