This document is archived and information here might be outdated.  Recommended version.


ICommandPoolEdit.CallOnCreate Method (ArcObjects .NET 10.5 SDK)
ArcObjects Library Reference (Controls)  

ICommandPoolEdit.CallOnCreate Method

Calls the specified command OnCreate method if the Hook is set and OnCreate has not already been called.

[Visual Basic .NET]
Public Sub CallOnCreate ( _
    ByVal pCommand As ICommand _
)
[C#]
public void CallOnCreate (
    ICommand pCommand
);
[C++]
HRESULT CallOnCreate(
  ICommand* pCommand
);
[C++]

Parameters pCommand [in]
pCommand is a parameter of type ICommand

Product Availability

Available with ArcGIS Engine.

Description

Calls the ICommand:OnCreate event for the specified command.

When a command is added to the CommandPool, the ICommandPool::Created property is set to false. If the ICommandPoolEdit::Hook property is set, the CallOnCreate method will pass the Hook into the command's ICommand:OnCreate method. The ICommandPool::Created property is then set to true.

To ensure that the ICommand:OnCreate method is called only once during the lifetime of the command object, subsquent calls to the CallOnCreate method will not do anything.

Errors Returned

1048 800a0418: The hook has not yet been set into the CommandPool
1036 800a040c: The supplied command does not exist in command pool

See Also

ICommandPoolEdit Interface