AFX_MODULE_STATE with USRDLL vs AFXDLLs
Posted on 1997-01-10
Will someone please explain how "Module state" is maintained
differently when using a USRDLL vs an AFXDLL? For example,
for a USRDLL, when an CWinApp's InitInstance is called,
the runtime automatically switches the state, but when I
use the shared MFC DLL, I must call AFX_MAINTAIN_STATE(...)
at the beginning of all exported functions.
I don't really understand what is going on with the state, especially when multithreading comes into the picture.
For example, if in an USRDLL I call AfxBeginThread and I'm
linking to shared MFC DLL, how does module state come into play?