I am on a very old MFC application and a lot of callbacks for GUI defined as follows which are spread across 100's of cpp files across different views/documents
ON_COMMAND(ID_FILE_OP1, OnFileOp1)
ON_UPDATE_COMMAND_UI(ID_FILE_OP1, OnUpdateFileOp1)
ON_COMMAND(ID_FILE_OP2, OnFileOp2)
ON_UPDATE_COMMAND_UI(ID_FILE_OP2, OnUpdateFileOp2)
A new requirement requires me to call a function after and before every ON_UPDATE_COMMAND_UI's defined call back function call and ON_COMMAND as well.
I am trying to create a #define so that a change is localised and works as a hooking mechanism for the call back begin end maybe.
I can definitely call my common function after and before each function call but I don't think that as a clean approach.
Whats the standard or a good approach for this ?
I wish to hook to ON_COMMAND & ON_UPDATE_COMMAND_UI call back functions cleanly from outside.
I am on Windows, Visual Studio 2015 x64.