CCmdTarget Class

The base class for the Microsoft Foundation Class Library message-map architecture.

class CCmdTarget : public CObject

Members

Public Constructors

Name

Description

CCmdTarget::CCmdTarget

Constructs a CCmdTarget object.

Public Methods

Name

Description

CCmdTarget::BeginWaitCursor

Displays the cursor as an hourglass cursor.

CCmdTarget::DoOleVerb

Causes an action specified by an OLE verb to be performed.

CCmdTarget::EnableAutomation

Allows OLE automation for the CCmdTarget object.

CCmdTarget::EnableConnections

Enables event firing over connection points.

CCmdTarget::EnableTypeLib

Enables an object's type library.

CCmdTarget::EndWaitCursor

Returns to the previous cursor.

CCmdTarget::EnumOleVerbs

Enumerates an object's OLE verbs.

CCmdTarget::FromIDispatch

Returns a pointer to the CCmdTarget object associated with the IDispatch pointer.

CCmdTarget::GetDispatchIID

Gets the primary dispatch interface ID.

CCmdTarget::GetIDispatch

Returns a pointer to the IDispatch object associated with the CCmdTarget object.

CCmdTarget::GetTypeInfoCount

Retrieves the number of type information interfaces that an object provides.

CCmdTarget::GetTypeInfoOfGuid

Retrieves the type description that corresponds to the specified GUID.

CCmdTarget::GetTypeLib

Gets a pointer to a type library.

CCmdTarget::GetTypeLibCache

Gets the type library cache.

CCmdTarget::IsInvokeAllowed

Enables automation method invocation.

CCmdTarget::IsResultExpected

Returns nonzero if an automation function should return a value.

CCmdTarget::OnCmdMsg

Routes and dispatches command messages.

CCmdTarget::OnFinalRelease

Cleans up after the last OLE reference is released.

CCmdTarget::RestoreWaitCursor

Restores the hourglass cursor.

Remarks

A message map routes commands or messages to the member functions you write to handle them. (A command is a message from a menu item, command button, or accelerator key.)

Key framework classes derived from CCmdTarget include CView, CWinApp, CDocument, CWnd, and CFrameWnd. If you intend for a new class to handle messages, derive the class from one of these CCmdTarget-derived classes. You will rarely derive a class from CCmdTarget directly.

For an overview of command targets and OnCmdMsg routing, see Command Targets, Command Routing, and Mapping Messages.

CCmdTarget includes member functions that handle the display of an hourglass cursor. Display the hourglass cursor when you expect a command to take a noticeable time interval to execute.

Dispatch maps, similar to message maps, are used to expose OLE automation IDispatch functionality. By exposing this interface, other applications (such as Visual Basic) can call into your application.

Inheritance Hierarchy

CObject

CCmdTarget

Requirements

Header: afxwin.h

See Also

Reference

CObject Class

Hierarchy Chart

CCmdUI Class

CDocument Class

CDocTemplate Class

CWinApp Class

CWnd Class

CView Class

CFrameWnd Class

COleDispatchDriver Class

Concepts

MFC Sample ACDUAL