Home > Software engineering >  CListCtrl * pList repeated calls to abnormal issue
CListCtrl * pList repeated calls to abnormal issue

Time:10-24

CListCtrl * pList=(CListCtrl *) GetDlgItem (IDC_LISTRESULT);
CStatic * pStatic=(CStatic *) GetDlgItem (IDC_STATICDUTINF);
When repeated calls CListCtrl and Static cursor exit abnormal program, program frame will be stuck in rings.




BOOL TestDlg: : _checkDUTLabels ()
{
Int iter=0;
Clock_t start and finish;
Float duration=0;
Start=clock ();
Cstrings STR.
CListCtrl * LST=(CListCtrl *) GetDlgItem (IDC_LISTRESULT);//repeated calls _checkDUTLabels this step will collapse
CStatic * staticinf=(CStatic *) GetDlgItem (IDC_STATICDUTINF);//repeated calls _checkDUTLabels this step will collapse
While (1)
{
If (/* TRUE==_ScanLables & amp; & */(_rev_com. Find (" Welcome to the BrightSign ")!=1 | | _rev_com. Find (" BrightSign>" )!=1))
{
Add2Log (" step5, find brightsign ok \ r \ n ", RGB (0, 255));
break;
}
Sleep (3000);
If (iter++ & gt; 40)
{
Finish=clock ();
Duration=(finish - start)/CLOCKS_PER_SEC (float).
STR. The Format (" % fs ", duration);
M_strLog +="TIMEOUT test (fail)" + STR + "\ r \ n";
LST - & gt; SetItemText (resline, 2, STR);
STR. The Format (" TIMEOUT# # # # # # # NA# NA# fail \ r \ n ");
M_strSFC +=STR;
M_strErrCode="TIMEOUT \ r \ n";//Check the LED Blink Fail
LST - & gt; SetItemText (resline++, 3, "FAIL");
LST - & gt; SetTextColor (RGB (128, 0, 0));
Staticinf - & gt; SetWindowText (error code: "TIMEOUT");
return FALSE;
}
}
GetDlgItem (IDC_STATICTESTINF) - & gt; SetWindowText (" DUT Testing... ");
return TRUE;
}

CodePudding user response:

Someone please reply?

CodePudding user response:

It is recommended to start the background thread processing operation of long time

  • Related