Share via

Handling Commands in the Document

Your document class may also handle certain commands generated by menu items, toolbar buttons, or accelerator keys. By default, CDocument handles the Save and Save As commands on the File menu, using serialization. Other commands that affect the data may also be handled by member functions of your document. For example, in the Scribble program, class CScribDoc provides a handler for the Edit Clear All command, which deletes all of the data currently stored in the document. Documents can have message maps, but unlike views, documents cannot handle standard Windows messages — only WM_COMMAND messages, or "commands."

See also

Using Documents