Click here to Skip to main content
15,909,656 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Syntax and Missing Identifiers---LONG Pin
---Mark---12-May-04 18:00
---Mark---12-May-04 18:00 
GeneralRe: Syntax and Missing Identifiers---LONG Pin
---Mark---12-May-04 18:04
---Mark---12-May-04 18:04 
GeneralRe: Syntax and Missing Identifiers---LONG Pin
Maxwell Chen12-May-04 18:22
Maxwell Chen12-May-04 18:22 
GeneralRe: Syntax and Missing Identifiers---LONG Pin
---Mark---12-May-04 18:43
---Mark---12-May-04 18:43 
GeneralAdvice for Books Pin
vnm612-May-04 16:18
vnm612-May-04 16:18 
GeneralRe: Advice for Books Pin
Anthony_Yio12-May-04 16:41
Anthony_Yio12-May-04 16:41 
GeneralRe: Advice for Books Pin
vnm613-May-04 21:01
vnm613-May-04 21:01 
GeneralCATCH_ALL and OnCtlColor Pin
Coremn12-May-04 15:01
Coremn12-May-04 15:01 
Hello I was trying to debug this code (see below), because after a few minutes it crashes.
So I used a try{ }catch(...) to catch the exception but I dont know what type of exception it was. Is there a way to tell?
I tried using TRY{} CATCH_ALL() but it dod not catch anything??

	try{<br />
  DeleteObject(hbr);	//must be deleted or eventually mem overflow<br />
  		hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);<br />
  		if (nCtlColor == CTLCOLOR_STATIC )<br />
  		{<br />
    			CWnd *Ctrl = GetDlgItem(pWnd->GetDlgCtrlID());<br />
<br />
    			if (Ctrl)<br />
    			{	<br />
      				CRect Rect; <br />
      				Ctrl->GetWindowRect(&Rect);<br />
	      			this->ScreenToClient(&Rect);<br />
	      			COLORREF Clr = GetDC()->GetPixel(Rect.left-1, Rect.top-1);<br />
	      			hbr = CreateSolidBrush(Clr);<br />
	      			ASSERT(pDC);<br />
	      			if(!m_staticTextBgd)<br />
	        			      	pDC->SetBkColor(Clr);<br />
	      			pDC->SetTextColor(RGB(m_fntR,m_fntG,m_fntB));<br />
	      			pDC->SetBkMode(m_staticTextBgd?OPAQUE:TRANSPARENT);<br />
    			}<br />
  }<br />
}<br />
catch(...)<br />
{<br />
   printf("Error");<br />
}<br />


I tried catching CResourceException and CMemoryException and many others but it did not catch anything?

How do I know what exception is being thrown?


---
GeneralRe: CATCH_ALL and OnCtlColor Pin
monrobot1312-May-04 15:29
monrobot1312-May-04 15:29 
GeneralRe: CATCH_ALL and OnCtlColor Pin
Coremn12-May-04 15:42
Coremn12-May-04 15:42 
GeneralRe: CATCH_ALL and OnCtlColor Pin
Coremn12-May-04 16:17
Coremn12-May-04 16:17 
GeneralRe: CATCH_ALL and OnCtlColor Pin
Ryan Binns12-May-04 18:02
Ryan Binns12-May-04 18:02 
GeneralInterface Methods Pin
monrobot1312-May-04 14:20
monrobot1312-May-04 14:20 
GeneralRe: Interface Methods Pin
Milton Karimbekallil12-May-04 21:06
Milton Karimbekallil12-May-04 21:06 
GeneralEXCEPTION_BREAKPOINT not raised Pin
Brian Tietz12-May-04 14:18
Brian Tietz12-May-04 14:18 
GeneralRe: EXCEPTION_BREAKPOINT not raised Pin
Ryan Binns12-May-04 18:21
Ryan Binns12-May-04 18:21 
GeneralATL 7 WTL 7.1 Pin
monrobot1312-May-04 13:59
monrobot1312-May-04 13:59 
GeneralRe: ATL 7 WTL 7.1 Pin
Michael Dunn12-May-04 15:37
sitebuilderMichael Dunn12-May-04 15:37 
GeneralRe: ATL 7 WTL 7.1 Pin
monrobot1312-May-04 16:09
monrobot1312-May-04 16:09 
QuestionMessageBox Not Displayed from Destructor? Pin
Justin Cooke12-May-04 11:56
Justin Cooke12-May-04 11:56 
AnswerRe: MessageBox Not Displayed from Destructor? Pin
Diddy14-May-04 0:56
Diddy14-May-04 0:56 
GeneralRe: MessageBox Not Displayed from Destructor? Pin
Justin Cooke14-May-04 6:41
Justin Cooke14-May-04 6:41 
GeneralRe: MessageBox Not Displayed from Destructor? Pin
Diddy18-May-04 1:19
Diddy18-May-04 1:19 
GeneralRemoval of source control (VSS) Pin
Janovetz12-May-04 11:56
Janovetz12-May-04 11:56 
Generalfade screen Pin
johansmits12-May-04 11:16
johansmits12-May-04 11:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.