I have an MDI application with two views. Each view opens up a modeless dialog which contains various buttons and controls. One such control is a static text that is supposed to be updated as video is stored on the hard disk. To do that, the following function calls are made:
Code:
static CWnd* pLabel = NULL;
pLabel = CWnd::FromHandle(hwnd)->GetDlgItem(IDC_FREE_LABEL);
CString freeLabel;
CString percentLabel;
freeLabel.LoadString(IDS_MSG_FREE_PCT);
percentLabel.Format("%d", freePercentage);
freeLabel = percentLabel + freeLabel;
pLabel->SetWindowText(freeLabel);
The SetWindowText(freeLabel) causes the program to crash. I did try going up the call stack but it just points me to the function containing the aboce code. Thanks a lot,
Amish