Windows SDK Graphics Problem

Please support our C++ advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Jan 2007
Posts: 15
Reputation: RossSCann is an unknown quantity at this point 
Solved Threads: 0
RossSCann RossSCann is offline Offline
Newbie Poster

Windows SDK Graphics Problem

 
0
  #1
Feb 2nd, 2007
This CreatePen call is failing after repeated calls


HDC hDC;
hDC=GetDC(hWnd);

apen = CreatePen(PS_SOLID, 1, colorG[7]);
oldPen=(HPEN)SelectObject(hDC, apen);

...line drawing stuff...

ReleaseDC(hWnd, hDC);

Apparently a memory leak even with the release

C++.net is the compiler

Any thoughts?
Reply With Quote Quick reply to this message  
Join Date: Dec 2005
Posts: 5,850
Reputation: Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute 
Solved Threads: 751
Team Colleague
Salem's Avatar
Salem Salem is offline Offline
Void main'ers are DOOMed

Re: Windows SDK Graphics Problem

 
0
  #2
Feb 2nd, 2007
> apen = CreatePen(PS_SOLID, 1, colorG[7]);
So delete/release/free/whatever the pen as well.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C++ Forum


Views: 1058 | Replies: 1
Thread Tools Search this Thread



Tag cloud for C++
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC