Share via


ICommandSource Interface

Manages commands sent from a command source object to a user control.

interface class ICommandSource

Members

Public Methods

Name

Description

ICommandSource::AddCommandHandler

Adds a command handler to a command source object.

ICommandSource::AddCommandRangeHandler

Adds a group of command handlers to a command source object.

ICommandSource::AddCommandRangeUIHandler

Adds a group of user interface command message handlers to a command source object.

ICommandSource::AddCommandUIHandler

Adds a user interface command message handler to a command source object.

ICommandSource::PostCommand

Posts a message without waiting for it to be processed.

ICommandSource::RemoveCommandHandler

Removes a command handler from a command source object.

ICommandSource::RemoveCommandRangeHandler

Removes a group of command handlers from a command source object.

ICommandSource::RemoveCommandRangeUIHandler

Removes a group of user interface command message handlers from a command source object.

ICommandSource::RemoveCommandUIHandler

Removes a user interface command message handler from a command source object.

ICommandSource::SendCommand

Sends a message and waits for it to be processed before returning.

Remarks

When you host a user control in an MFC View, CWinFormsView Class routes commands and update command UI messages to the user control to allow it to handle MFC commands (for example, frame menu items and toolbar buttons). By implementing ICommandTarget Interface, you give the user control a reference to the ICommandSource object.

See How to: Add Command Routing to the Windows Forms Control for an example of how to use ICommandTarget.

For more information on using Windows Forms, see Using a Windows Form User Control in MFC.

Requirements

Header: afxwinforms.h (defined in assembly atlmfc\lib\mfcmifc80.dll)

See Also

Tasks

How to: Add Command Routing to the Windows Forms Control

Reference

ICommandTarget Interface