You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/mfc/reference/message-map-macros-mfc.md
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -90,7 +90,7 @@ DECLARE_MESSAGE_MAP( )
90
90
> [!NOTE]
91
91
> If you declare any member after `DECLARE_MESSAGE_MAP`, you must specify a new access type (**public**, `private`, or `protected`) for them.
92
92
93
-
For more information on message maps and the `DECLARE_MESSAGE_MAP` macro, see [Message Handling and Mapping Topics](message-handling-and-mapping.md).
93
+
For more information on message maps and the `DECLARE_MESSAGE_MAP` macro, see [Message Handling and Mapping Topics](../../mfc/message-handling-and-mapping.md).
94
94
95
95
### Example
96
96
```cpp
@@ -145,7 +145,7 @@ END_MESSAGE_MAP( )
145
145
```
146
146
147
147
### Remarks
148
-
For more information on message maps and the `END_MESSAGE_MAP` macro, see [Message Handling and Mapping Topics](message-handling-and-mapping.md).
148
+
For more information on message maps and the `END_MESSAGE_MAP` macro, see [Message Handling and Mapping Topics](../../mfc/message-handling-and-mapping.md).
149
149
150
150
### Requirements
151
151
**Header:** afxwin.h
@@ -171,7 +171,7 @@ ON_COMMAND( id, memberFxn )
171
171
172
172
When a command-target object receives a Windows **WM_COMMAND** message with the specified ID, `ON_COMMAND` will call the member function `memberFxn` to handle the message.
173
173
174
-
Use `ON_COMMAND` to map a single command to a member function. Use [ON_COMMAND_RANGE](#on_command_range) to map a range of command ids to one member function. Only one message-map entry can match a given command id. That is, you can't map a command to more than one handler. For more information and examples, see [Message Handling and Mapping Topics](message-handling-and-mapping.md).
174
+
Use `ON_COMMAND` to map a single command to a member function. Use [ON_COMMAND_RANGE](#on_command_range) to map a range of command ids to one member function. Only one message-map entry can match a given command id. That is, you can't map a command to more than one handler. For more information and examples, see [Message Handling and Mapping Topics](../../mfc/message-handling-and-mapping.md).
There should be exactly one `ON_CONTROL` macro statement in your message map for every control notification message that must be mapped to a message-handler function.
209
209
210
-
For more information and examples, see [Message Handling and Mapping Topics](message-handling-and-mapping.md).
210
+
For more information and examples, see [Message Handling and Mapping Topics](../../mfc/message-handling-and-mapping.md).
> In addition to user-defined messages, `ON_MESSAGE` handles less common Windows messages. For more information, see Knowledge Base article [99848: INFO: Use ON_MESSAGE() Macro to Map Less-Common Messages](http://go.microsoft.com/fwlink/?linkId=192022).
241
241
242
-
For more information and examples, see [Message Handling and Mapping Topics](message-handling-and-mapping.md) and [User-Defined Handlers](user-defined-handlers.md)
242
+
For more information and examples, see [Message Handling and Mapping Topics](../../mfc/message-handling-and-mapping.md) and [User-Defined Handlers](user-defined-handlers.md)
243
243
244
244
### Example
245
245
```cpp
@@ -288,7 +288,7 @@ ON_OLECMD( pguid, olecmdid, id )
288
288
### Remarks
289
289
`IOleCommandTarget` allows a container to receive commands that originate in a DocObject's user interface, and allows the container to send the same commands (such as New, Open, SaveAs, and Print on the File menu; and Copy, Paste, Undo, and so forth on the Edit menu) to a DocObject.
290
290
291
-
`IOleCommandTarget` is simpler than OLE Automation's `IDispatch`. `IOleCommandTarget` relies entirely on a standard set of commands that rarely have arguments, and no type information is involved (type safety is diminished for command arguments as well). If you do need to dispatch commands with arguments, use [COleServerDoc::OnExecOleCmd](coleserverdoc.md#onexecolecmd.md).
291
+
`IOleCommandTarget` is simpler than OLE Automation's `IDispatch`. `IOleCommandTarget` relies entirely on a standard set of commands that rarely have arguments, and no type information is involved (type safety is diminished for command arguments as well). If you do need to dispatch commands with arguments, use [COleServerDoc::OnExecOleCmd](coleserverdoc-class.md#onexecolecmd.md).
292
292
293
293
The `IOleCommandTarget` standard menu commands have been implemented by MFC in the following macros:
There should be exactly one `ON_UPDATE_COMMAND_UI` macro statement in your message map for every user-interface update command that must be mapped to a message-handler function.
498
498
499
-
For more information and examples, see [Message Handling and Mapping Topics](message-handling-and-mapping.md).
499
+
For more information and examples, see [Message Handling and Mapping Topics](../../mfc/message-handling-and-mapping.md).
The range of IDs starts with `id1` and ends with `id2`.
528
528
529
-
Use `ON_COMMAND_RANGE` to map a range of command IDs to one member function. Use [ON_COMMAND](#on_command) to map a single command to a member function. Only one message-map entry can match a given command ID. That is, you can't map a command to more than one handler. For more information on mapping message ranges, see [Handlers for Message-Map Ranges](handlers-for-message-map-ranges.md).
529
+
Use `ON_COMMAND_RANGE` to map a range of command IDs to one member function. Use [ON_COMMAND](#on_command) to map a single command to a member function. Only one message-map entry can match a given command ID. That is, you can't map a command to more than one handler. For more information on mapping message ranges, see [Handlers for Message-Map Ranges](../../mfc/handlers-for-message-map-ranges.md).
530
530
531
531
There is no automatic support for message map ranges, so you must place the macro yourself.
There is no automatic support for message map ranges, so you must place the macro yourself.
610
610
611
-
For more information on implementing handler functions for a range of control IDs, refer to [Handlers for Message-Map Ranges](handlers-for-message-map-ranges.md).
611
+
For more information on implementing handler functions for a range of control IDs, refer to [Handlers for Message-Map Ranges](../../mfc/handlers-for-message-map-ranges.md).
0 commit comments