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) );
}