943,514 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 1486
  • C++ RSS
Feb 2nd, 2007
0

Windows SDK Graphics Problem

Expand Post »
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?
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
RossSCann is offline Offline
17 posts
since Jan 2007
Feb 2nd, 2007
0

Re: Windows SDK Graphics Problem

> apen = CreatePen(PS_SOLID, 1, colorG[7]);
So delete/release/free/whatever the pen as well.
Team Colleague
Reputation Points: 5862
Solved Threads: 950
Posting Sage
Salem is offline Offline
7,164 posts
since Dec 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: C++ vs. VB
Next Thread in C++ Forum Timeline: MinGW equivalent for OSX?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC