Click here to Skip to main content
15,918,967 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: C and memory help Pin
Larry J. Siddens25-Sep-03 13:03
Larry J. Siddens25-Sep-03 13:03 
GeneralRe: C and memory help Pin
Sirrius25-Sep-03 14:46
Sirrius25-Sep-03 14:46 
GeneralRe: C and memory help Pin
Larry J. Siddens25-Sep-03 15:02
Larry J. Siddens25-Sep-03 15:02 
GeneralID of a child dialog Pin
Antti Keskinen25-Sep-03 11:42
Antti Keskinen25-Sep-03 11:42 
GeneralRe: ID of a child dialog Pin
Antti Keskinen25-Sep-03 11:49
Antti Keskinen25-Sep-03 11:49 
GeneralApp is crashing when trying to restore Brushes and Fonts Pin
Terry O'Nolley25-Sep-03 9:56
Terry O'Nolley25-Sep-03 9:56 
GeneralRe: App is crashing when trying to restore Brushes and Fonts Pin
Alvaro Mendez25-Sep-03 10:19
Alvaro Mendez25-Sep-03 10:19 
GeneralRe: App is crashing when trying to restore Brushes and Fonts Pin
Terry O'Nolley25-Sep-03 10:46
Terry O'Nolley25-Sep-03 10:46 
It crashes in afxwin1.inl :

_AFXWIN_INLINE HGDIOBJ CGdiObject::GetSafeHandle() const<br />
	{ return this == NULL ? NULL : m_hObject; }


I need to use Rectangle because need the border around the rectangle. All of my CGDIObjects are crashing when I try to restore the old objects (CFont). I just showed you the smallest piece of code that still produces the unhandled exception.

I am passing the function a CPaintDC* from within the OnPaint handler.

Does the fact that it is a CPaintDC mean I don't need to restore the old CGDIObjects?

I indicated in a comment on my first post the exact line where it is crashing. It is crashing when I try to restore the old CBrush.

Is it because the old CBrush was declared as CBrush* but never initialized with CreateSolidBrush?
I didn't think I needed to do that since it's value would be assigned by the return value of dc->SelectObject(NewBrush).

Everything is working fine, but I have a nagging feeling that something isn't right.









GeneralRe: App is crashing when trying to restore Brushes and Fonts Pin
Michael Dunn25-Sep-03 10:32
sitebuilderMichael Dunn25-Sep-03 10:32 
GeneralRe: App is crashing when trying to restore Brushes and Fonts Pin
Terry O'Nolley25-Sep-03 11:06
Terry O'Nolley25-Sep-03 11:06 
QuestionConversion from DB_NUMERIC to double? Pin
Rene De La Garza25-Sep-03 9:50
Rene De La Garza25-Sep-03 9:50 
AnswerRe: Conversion from DB_NUMERIC to double? Pin
Steve S25-Sep-03 22:45
Steve S25-Sep-03 22:45 
Generalspeaker volume too low Pin
Binayak25-Sep-03 9:40
Binayak25-Sep-03 9:40 
GeneralRe: speaker volume too low Pin
David Crow25-Sep-03 9:45
David Crow25-Sep-03 9:45 
GeneralRe: speaker volume too low Pin
Binayak25-Sep-03 10:14
Binayak25-Sep-03 10:14 
GeneralRe: speaker volume too low Pin
David Crow25-Sep-03 10:19
David Crow25-Sep-03 10:19 
GeneralRe: speaker volume too low Pin
Binayak25-Sep-03 10:22
Binayak25-Sep-03 10:22 
GeneralRe: speaker volume too low Pin
David Crow25-Sep-03 10:25
David Crow25-Sep-03 10:25 
GeneralRe: speaker volume too low Pin
Binayak25-Sep-03 10:27
Binayak25-Sep-03 10:27 
GeneralRe: speaker volume too low Pin
David Crow25-Sep-03 10:31
David Crow25-Sep-03 10:31 
GeneralRe: speaker volume too low Pin
Alvaro Mendez25-Sep-03 11:05
Alvaro Mendez25-Sep-03 11:05 
GeneralRe: speaker volume too low Pin
Binayak25-Sep-03 11:06
Binayak25-Sep-03 11:06 
GeneralRe: speaker volume too low Pin
73Zeppelin26-Sep-03 6:12
73Zeppelin26-Sep-03 6:12 
QuestionOCX perhaps ??? Pin
The_Server25-Sep-03 9:36
The_Server25-Sep-03 9:36 
GeneralRe: MFC/W32 Bitmap/Icon editor in source... Pin
igor196025-Sep-03 9:13
igor196025-Sep-03 9:13 

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.