Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Confused by BEGIN_MSG_MAP and BEGIN_MSG_MAP_EX

Tags:

c++

winapi

atl

wtl

I am tracing a bug and I suspect the root could be in the use of WTL macros. When sould I use *_EX and when normal macros. For BEGIN_MSG_MAP_EX there is a note in atlcrack.h

// Note about message maps with cracked handlers:
// For ATL 3.0, a message map using cracked handlers MUST use BEGIN_MSG_MAP_EX.
// For ATL 7.0 or higher, you can use BEGIN_MSG_MAP for CWindowImpl/CDialogImpl derived classes,
// but must use BEGIN_MSG_MAP_EX for classes that don't derive from CWindowImpl/CDialogImpl.

but how about the rest or the macros ? can I use both COMMAND_ID_HANDLER and COMMAND_ID_HANDLER_EX in the same BEGIN_MSG_MAP_EX for example ?

like image 234
cprogrammer Avatar asked Dec 09 '25 23:12

cprogrammer


1 Answers

I recommend BEGIN_MSG_MAP_EX because it supports more handlers. It also supports the BEGIN_MSG_MAP handlers.

like image 131
rmrrm Avatar answered Dec 11 '25 11:12

rmrrm



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!