some notes on how to create a dll with vc++ for mfc:

From newsgroup:

>I hope the information I give here is not too vague.  Basically I have
>created a dll to be loaded dynamically by another application.  This
>appear to work successfully as I start getting valid information from
>the dll.  I invoke a command and the dll returns a vector of ints of
>the proper size and as iterate through the vector, I use the ints to
>send to the dll to return some string data.  That seems to start
>coming in properly but at the time I fully complete the loop on the
>original vector, I get a "user breakpoint called from code" error.  If
>I ignore that and continue, I get a "debug assertion error from file
>dbgheap.c
>
>I am at a loss on how to start troubleshooting this.  Can anyone help?
>
>Thanks
>
>
>
>---------------------------------------
>What could possibly go wrong?

You should link everyone dynamically to the same CRT DLL, e.g.
msvcrt.dll for release builds. That will solve problems involving
multiple active heaps and avoid others involving CRT state which is
supposed to be shared by the whole program, not maintained separately
in each module. In the IDE, MFC apps should choose "Use MFC in a
shared DLL" on the Project Settings General tab, and other types of
projects should select the "Multithreaded DLL" for "Use runtime
library" in the Project Settings C/C++ tab. (Use "Debug Multithreaded
DLL" for debug builds, naturally.)



>What you say makes some sense to me.  However, when I change the dll
>project to "Use Multithreaded DLL", I get the following errors:
>
>nafxcwd.lib(timecore.obj) : error LNK2001: unresolved external symbol
>__mbctype
>nafxcwd.lib(apphelp.obj) : error LNK2001: unresolved external symbol
>__mbctype
>nafxcwd.lib(filelist.obj) : error LNK2001: unresolved external symbol
>__mbctype
>nafxcwd.lib(appcore.obj) : error LNK2001: unresolved external symbol
>___argv
>nafxcwd.lib(appcore.obj) : error LNK2001: unresolved external symbol
>___argc

You're using MFC, so follow the instructions to "Use MFC in a shared
DLL". You'll also need to rebuild all.

>You're using MFC, so follow the instructions to "Use MFC in a shared
>DLL". You'll also need to rebuild all.

That did the trick.