Click here to Skip to main content
15,924,196 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: I desperately need Pin
27-Feb-01 1:12
suss27-Feb-01 1:12 
GeneralRe: I desperately need Pin
l a u r e n27-Feb-01 1:08
l a u r e n27-Feb-01 1:08 
GeneralProblems with hooking events!! HELP !! Pin
TomK26-Feb-01 21:16
TomK26-Feb-01 21:16 
QuestionHow to make a deque from scratch in C++ Pin
Theo26-Feb-01 15:53
Theo26-Feb-01 15:53 
AnswerRe: How to make a deque from scratch in C++ Pin
l a u r e n26-Feb-01 21:29
l a u r e n26-Feb-01 21:29 
QuestionHow to resize the DataGrid columns ! Pin
26-Feb-01 12:23
suss26-Feb-01 12:23 
GeneralCPen leaking memory - ARGH !!!! Pin
Christian Graus26-Feb-01 12:13
protectorChristian Graus26-Feb-01 12:13 
GeneralRe: CPen leaking memory - ARGH !!!! Pin
Todd Wilson26-Feb-01 12:59
Todd Wilson26-Feb-01 12:59 
Modify your SafeSelect functions like this:

if (m_pOldPen!=NULL) SelectObject(m_pOldPen);
if (pPen!=NULL) m_pOldPen = SelectObject(pPen); else m_pOldPen=NULL;
return m_pOldPen;

Same for the brush version.

Now, if you are detaching the DC handle from the CDC base class, then your destructor is worthless, since the DC handle is gone.

The other problem is that I did not see a constructor for your CGDC class. Assuming that you're using the base CDC, then the DC handle is null, and SelectObject will either (a) do nothing (b) bomb (c) leak.

Just my $0.02

GeneralRe: CPen leaking memory - ARGH !!!! Pin
26-Feb-01 13:07
suss26-Feb-01 13:07 
GeneralRe: CPen leaking memory - ARGH !!!! Pin
Todd Wilson26-Feb-01 13:25
Todd Wilson26-Feb-01 13:25 
GeneralRe: CPen leaking memory - ARGH !!!! Pin
26-Feb-01 13:58
suss26-Feb-01 13:58 
GeneralRe: CPen leaking memory - ARGH !!!! Pin
Erik Funkenbusch26-Feb-01 13:40
Erik Funkenbusch26-Feb-01 13:40 
GeneralCDialog and dll Pin
Mel Stober26-Feb-01 12:10
Mel Stober26-Feb-01 12:10 
GeneralProblem displaying arbitrary Solid Brushs between machines Pin
Michael A Barnhart26-Feb-01 6:27
Michael A Barnhart26-Feb-01 6:27 
GeneralRe: Problem displaying arbitrary Solid Brushs between machines Pin
l a u r e n26-Feb-01 10:29
l a u r e n26-Feb-01 10:29 
GeneralRe: Problem displaying arbitrary Solid Brushs between machines Pin
Michael A Barnhart28-Feb-01 2:09
Michael A Barnhart28-Feb-01 2:09 
GeneralRe: Processes Pin
l a u r e n26-Feb-01 6:08
l a u r e n26-Feb-01 6:08 
GeneralRe: Processes Pin
l a u r e n27-Feb-01 1:02
l a u r e n27-Feb-01 1:02 
GeneralRe: Processes Pin
28-Feb-01 1:55
suss28-Feb-01 1:55 
GeneralUnique system id Pin
26-Feb-01 5:03
suss26-Feb-01 5:03 
GeneralStarting an App.Exe at Bootup time using NT Service Pin
trilok_soni26-Feb-01 2:34
trilok_soni26-Feb-01 2:34 
QuestionODBC drivers? Pin
Kannan26-Feb-01 0:52
Kannan26-Feb-01 0:52 
GeneralString table Pin
26-Feb-01 0:02
suss26-Feb-01 0:02 
GeneralRe: String table Pin
Tim Deveaux26-Feb-01 4:32
Tim Deveaux26-Feb-01 4:32 
QuestionWindows Installer's DLL's? Pin
AlexMarbus25-Feb-01 23:17
AlexMarbus25-Feb-01 23:17 

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.