Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unhandled Exception

Status
Not open for further replies.

aaadetos

Programmer
Nov 21, 2004
54
US
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();
		}
 
>What could be the reason for this?

It could be a lot of things. What are you passing to SetWindowText?

This would definately throw something:
Code:
CString* s=0;
SetWindowText(*s);


/Per

www.perfnurt.se
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top