If you are converting an existing project to an MFC Extension DLL, start with the standard rules for building an application using the _AFXDLL version of MFC. Then follow these steps:
Add /D_AFXEXT to the compiler flags. On the Project Settings dialog, select the C/C++ tab. Then select the Preprocessor category. Add _AFXEXT to the Preprocessor Definitions field, separating each of the items with commas.
Remove the /Gy compiler switch. On the Project Setting dialog, select the C/C++ tab. Then select the C Language category. Ensure that the "Enable Function-Level Linking" checkbox is cleared. This will make it easier to export classes because the linker will not remove unreferenced functions. If the original project is used to build a Regular DLL statically linked to MFC, change the /MT[d] compiler option to /MD[d].
Build an export library with the /DLL option to LINK. This will be set when you create a new target, specifying Win32 Dynamic-Link Library as the target type.