c++ - Determing caller ID from DoDataExchange in MFC -


I want to apply a function that behaves differently for different IDs from my menu resources. For example:

ON_COMMAND (ID_1, function) ON_COMMAND (ID_2, function) ON_COMMAND (ID_3, function) zero function () {switch (ID) case ID_1: // break it; Case ID_2: // Break what to do; ...

Is there any way to identify calling processing?

ON_COMMAND_RANGE Consider using a macro in the message handler UINT nID parameter:

  afx_msg void Func (UINT nID); ON_COMMAND_RANGE (ID_1, ID_3, Func)  

Note: This macro is not supported by the MFC Application Wizard, you must add it manually. The resource ID category should be nearby.


Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -