Hi, I have a dialog-based MFC application, which compiles w/out error, but yields an unhandled exception in C:\...\MFC\SRC\WINCORE.CPP when i try to run it, as shown in the code below. What could be the reason for this? How do i correct it?
Code:
HWND hWnd = ::GetDlgItem(m_hWnd, nID);
if (hWnd != NULL)
{
int nLen = ::GetWindowTextLength(hWnd);
::GetWindowText(hWnd, rString.GetBufferSetLength(nLen), nLen+1);//exception here
rString.ReleaseBuffer();
}