I have ON_COMMAND and ON_UPDATE_COMMAND_UI handlers for menu items in an MFC dll. But they are not invoked. The same code compiled as .exe has the handlers being invoked. What could be the reason for this?
相关问题
- Sorting 3 numbers without branching [closed]
- How to compile C++ code in GDB?
- Why does const allow implicit conversion of refere
- How to know full paths to DLL's from .csproj f
- thread_local variables initialization
相关文章
- vs2017wpf项目引用dll的路径不正确的问题
- Class layout in C++: Why are members sometimes ord
- How to mock methods return object with deleted cop
- Which is the best way to multiply a large and spar
- C++ default constructor does not initialize pointe
- Selecting only the first few characters in a strin
- What exactly do pointers store? (C++)
- Converting glm::lookat matrix to quaternion and ba
ON_UPDATE_COMMAND_UI and ON_COMMAND handler are only called when the object that contains the handler is within the command routing.
So the DLL itself isn't the problem but also this depends on how you created your DLL. For a standard DLL and without sharing the MFC as a DLL this will not work at all. AFAIK to get it run the DLL should be an extension DLL loaded into the application. The reason is that the main application wil not recognize your objects in a standard DLL when the MFC is statically linked.
Read more about command routing in the MSDN and in the technical notes