CString多次引用的问题,程序退出时提示错误,出错提示为:File:dbgheap.c Line:1017
在一个头文件a.h中定义了
CString hu;
在头文件b.h中定义了
extern CString hu;
在c.h文件中定义
#include "a.h"
UINT ty(LPVOID pParam)
{
for(int i=0;i <20;i++)
{
aa+="dd";//执行文件退出关闭时,此句导致出错。出错提示为:File:dbgheap.c Line:1017。去掉这句就不会有出错提示。
}
AfxMessageBox(aa,NULL,MB_OK);
return 0;
}
在d.cpp文件中调用
void CTest3View::OnEDITvvv()
{
// TODO: Add your command handler code here
AfxBeginThread(ty,this);
}
在e.cpp文件中使用
#include "b.h"
在f.cpp文件中使用
#include "b.h"
只要运行调用CTest3View::OnEDITvvv()函数,程序退出时,会立即报错。
我在e.cpp、f.cpp文件中都要用到hu保存全局结果,那怎么处理啊???