On Visual Studio 2011, this worked for me:
Project -> "project" Properties -> Configuration Properties -> General -> Project Defaults -> Use of MFC :
Use MFC in a shared DLL
(In Visual Studio 2019, the latter setting can be found in “Properties -> Configuration Properties -> Advanced -> Use of MFC
“