首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

CRT detected that .worte buffer after end of heap(#88),该如何解决

2013-07-04 
CRT detected that ...worte buffer after end of heap(#88)void PLYTTS2(HWND hwndTxt,HWND hwndPlay,HWN

CRT detected that ...worte buffer after end of heap(#88)


void PLYTTS2(HWND hwndTxt,HWND hwndPlay,HWND hwndStatus,String sTxt)
{
SendMessage(hwndTxt,WM_SETTEXT,NULL,(LPARAM)sTxt.str());
char sStatus[100];
do{
Sleep(200);
GetWindowText(hwndStatus,sStatus,100);
}while(sStatus[0]==-43);
}

unsigned int __stdcall ThreadReadClipboard(void* pArg)
{
String sClip,sOnce,sSymbol,sPrncSym,sAbbr,sPrncAbbr,sToTTS,sURL,sPath,sTxt(100); char sElmt[128]; HANDLE hFind; WIN32_FIND_DATA fd;
int iClip,ia,iElmt,nSpaces;
HWND hwndIE=NULL,hwndIEAddr=NULL,hwndIEWMP,hwndWvCn=NULL,hwndWvView=NULL,hwndWvRcd,hwndWvSave,
hwndWvFName,hwndTTS=NULL,hwndTxt,hwndPlay,hwndStatus;
EWParam ew; WvCn wvView;
if(! sClip.FromClipboard() ) return 1;
SetWindowText(g_hwnd,"Recording");
sSymbol=". - -> / // /* */ > < >> << \\ & | ^ ! != ( ) [ ] { } % ? @ ~ ";
 for(,,)//遍历
 {
  {...}
traversal2:
   if(!g_bWorking)
   {
    SetWindowText(g_hwnd,"");
    return 1;//异常退出?
   }
 }//遍历结束
 if(sTxt.len()) {PLYTTS2(hwndTxt,hwndPlay,hwndStatus,sTxt);sTxt="";}
 SetWindowText(g_hwnd,""); return 1;
}

void ReadClipboard()//按下R键开启工作者线程或设停全局变量
{
g_bWorking=!g_bWorking;
if(g_bWorking) CloseHandle( (HANDLE)_beginthreadex(NULL,0,ThreadReadClipboard,NULL,0,NULL) );
}

报错,跟踪到return 1;语句 就粘这些代码了,大家看看
[解决办法]
看哪里有动态分配内存,并且有对分配的内存进行赋值操作,并且有越界的。

热点排行