CCmdTarget
CCmdTarget is the base class for the Microsoft Foundation Class Library message-map architecture. 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.)
CCmdTarget是微软基础类库消息映射体系中的基类。消息映射安排命令或消息到你编写的成员函数来处理它们。(命令是来自菜单项、命令按钮或快捷键的消息。)
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.
继承自CCmdTarget的(关键框架)类包括CView, CWinApp, CDocument, CWnd, 和CFrameWnd。如果你打算用一个新的类来处理消息,(请)从这些CCmdTarget派生类来继承那个(新)类。你会很少直接从CCmdTarget继承一个类。
For an overview of command targets and OnCmdMsg routing, see Command Targets, Command Routing, and Mapping Messages in Visual C++ Programmer's Guide.
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.
CCmdTarget包含用于显示沙漏光标的成员函数。当你预料一个命令的执行(会明显地占用一段时间)时,请显示沙漏光标。
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. For more information on the IDispatch interfaces, see Creating the IDispatch Interface and Dispatch Interface and API Functions in the Win32 SDK OLE Programmer's Reference.
#include <afxwin.h>
Class Members | Base Class | Hierarchy Chart
Sample MFC Sample ACDUAL
See Also CCmdUI, CDocument, CDocTemplate, CWinApp, CWnd, CView, CFrameWnd, COleDispatchDriver