Archived

This topic is now archived and is closed to further replies.

Shannon Barber

UpdateData()

Recommended Posts

hehe
not only did I know the answer to this, i had already written the code to do it... i was just calling updatedate for no reason

    
DWORD now = clock();
DWORD elapsed = now - timesnap;
timesnap = now;
CStatic* fr = (CStatic*)GetDlgItem(IDC_STATIC_CLOCK);
char stemp[80];
itoa(elapsed,stemp,10);
CString str("Elapsed: ");
str += stemp + CString("ms");
itoa(timer,stemp,10);
str += CString(" Delay: ") + stemp + CString("ms");
fr->SetWindowText(str);
//UpdateData(false);

Share this post


Link to post
Share on other sites
The correct method of doing this depends on the control you are updating. For instance, SetWindowText is a method to update edit control text without calling OnUpdate, but to update a CComboBox you would probably use SetCurSel or SetEditSel. Reference MSDN help for the item you wish to explicitly update.

Share this post


Link to post
Share on other sites