I was trying the code below:
--------------------------------------------------Code:-------------------------------------------------- void CChildView::OnMatlabTry3() { // TODO: Add your command handler code here CDC *pDC = GetDC(); CString i_String(""); for (int i = 0; i < 10000000 ; i++) { i_String.Format("%d", i); pDC->TextOutA(300, 100, i_String); pDC->MoveTo(0, 0); pDC->LineTo(100, 300+i/10000); } pDC->DeleteDC(); }
It is the Event Handler to the menu. When I run this part, the program is running, but it consume 40% of the CPU resource and I can't move the program window. So is there any function that I can use to slow the program down?




Reply With Quote