Are there any MFC classes or functions that cannot be used in an MFC DLL?


The new home for Visual Studio documentation is Visual Studio 2017 Documentation on

The latest version of this topic can be found at Visual Studio 2017 Documentation. Extension DLLs use the CWinApp-derived class of the client application. They must not have their own CWinApp-derived class.

Regular DLLs must have a CWinApp-derived class and a single object of that application class, as does an MFC application. Unlike the CWinApp object of an application, the CWinApp object of the DLL does not have a main message pump.

Note that because the CWinApp::Run mechanism does not apply to a DLL, the application owns the main message pump. If the DLL opens modeless dialog boxes or has a main frame window of its own, the application's main message pump must call a routine exported by the DLL, which in turn calls the CWinApp::PreTranslateMessage member function of the DLL's application object.

DLL Frequently Asked Questions