Compartir a través de


ICommandTarget::Initialize

Initializes the command target object.

void Initialize(
   ICommandSource^ cmdSource
);

Parameters

  • cmdSource
    A handle to the command source object.

Remarks

When you host a user control in an MFC View, CWinFormsView routes commands and update command UI messages to the user control to allow it to handle MFC commands.

This method initializes the command target object and associates it with the specified command source object cmdSource. It should be called in the user control class implementation. At initialization, you should register command handlers with the command source object by calling ICommandSource::AddCommandHandler in the Initialize implementation. See How to: Add Command Routing to the Windows Forms Control for an example of how to use Initialize to do this.

Requirements

Header: afxwinforms.h

See Also

Concepts

ICommandTarget Interface

ICommandSource Interface