954,506 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Windows SDK Graphics Problem

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?

RossSCann
Newbie Poster
18 posts since Jan 2007
Reputation Points: 10
Solved Threads: 0
 

> apen = CreatePen(PS_SOLID, 1, colorG[7]);
So delete/release/free/whatever the pen as well.

Salem
Posting Sage
Team Colleague
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You