MFC扩展DLL导出类的有关问题

MFC扩展DLL导出类的问题
项目中将某些类封成DLL,有普通类,也有MFC的视图和文档类。现在有一普通类,主要是完成全局数据的初始化的保存工作。
DLL中:
class   CGlobalData
{
        map <int,CData>     m_mDataAll;
        void   Init(LPCTSTR   mainPath);     //读取数据,存入map中
}
主程序中
CGlobal     *m_pGlobal   =   new   CGlogal();
m_pGlobal-> Init(xxxx);
程序运行以后,m_pGloabal中map的数据用迭代器取的时候,第一个可以取出来。取
以后的就指针异常。调试跟进DLL,里面运行一切正常。请问这是什么问题,是不是
调用DLL运行以后,里面加入到MAP中的内存自动释放了,还是其它问题。期待大家的帮助。谢谢


------解决方案--------------------
代码本身是否有什么问题?
------解决方案--------------------
You may experience an access violation when you access an STL object through a pointer or reference in a different DLL or EXE
http://support.microsoft.com/kb/172396/
How to export an instantiation of a Standard Template Library (STL) class and a class that contains a data member that is an STL object
http://support.microsoft.com/kb/168958
------解决方案--------------------
The meaning that you must explicitly declare the importing/exporting definition of __declspec(dllexport)/__declspec(dllimport) for the class.