I am getting this linker error.
mfcs80.lib(dllmodul.obj) : error LNK2005: _DllMain@12 already defined in MSVCRT.lib(dllmain.obj)
Just #undef the _USRDLL before including afx.h, or even better, edit your project configuration and remove the macro.
#undef
_USRDLL
afx.h
This is the usual configuration for a MFC extension DLL: Build Settings for an MFC DLL