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

HTML/CSS - Automatically set height width from background image? -

php - Mysql Show Process - Sleep Commands and what to do -

c - What is the address of buf (the local variable in the main function)? -