Hi joeccmou,
The problem is with static linking, you are ending up with 2 heaps in the same process and this can cause all sorts of problems. STL data structures are being allocated on one and attempted to be freed on the other. I took your exact code here and ran no problem in an MFC application if I used "Use of MFC" as "Use MFC in a Shared DLL". My recommendation is to avoid static linking if you can.
We currently don't officially support static linking yet, but have a feature request open for it that you could vote on. Alternately some people have been successful building and using static linking themselves. The feature request contains a link to a blog explaining how someone has accomplished it.
Steve
The problem is with static linking, you are ending up with 2 heaps in the same process and this can cause all sorts of problems. STL data structures are being allocated on one and attempted to be freed on the other. I took your exact code here and ran no problem in an MFC application if I used "Use of MFC" as "Use MFC in a Shared DLL". My recommendation is to avoid static linking if you can.
We currently don't officially support static linking yet, but have a feature request open for it that you could vote on. Alternately some people have been successful building and using static linking themselves. The feature request contains a link to a blog explaining how someone has accomplished it.
Steve