Under MFC, the menu commands are all corresponding to the main window or sub-window (this is subordinate), so you must do the response function under the main window or sub-window. Of course, you can call the sub-defined class in the response function, or send a message to the custom class to control the sub-defined class.
It is recommended to use ClassWizard above menu items in resources to create menu response functions.