Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.

Robert Kulp

SetDCPenColor not found

This topic is 5303 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, everyone. I have a problem that's driving me nuts, and any help would be greatly appreciated. I'm trying to use this bit of code to change colors when drawing shapes:
SelectObject(memDC, GetStockObject(DC_PEN));
SelectObject(memDC, GetStockObject(DC_BRUSH));

SetDCPenColor(memDC, RGB(255,255,255));
SetDCBrushColor(memDC, RGB(128,128,128));
Now, from everything I've read in the help, this should work. I have windows.h included, and the gdi32.lib file is 'inherited' (if this is the correct term), and I'm running Windows XP. According to the help, that's all you need to be able to use SetDCPenColor and SetDCBrushColor. The little helpbox will even appear when you hover over the function name. The problem is, when I try to compile, Visual Studio .NET 2003 can't seem to find DC_PEN, DC_BRUSH, SetDCPenColor, or SetDCBrushColor! This is very strange to me, since it obviously knows about them... I've tried searching the net for help on this for a few hours last night, and haven't found ANY information on using these functions. Anyone know what's going on, and more importantly how to fix it? [edited by - Robert Kulp on May 9, 2004 12:55:00 PM]

Share this post

Link to post
Share on other sites
#define _WIN32_WINNT to be greater than or equal to 0x0500

Thanks Salsa!Colin Jeanne | Invader''s Realm
"I forgot I had the Scroll Lock key until a few weeks ago when some asshole program used it. It even used it right" - Conner McCloud

Share this post

Link to post
Share on other sites
Thanks Invader X! That seemed to fix it.

From what I could gather looking through the wingdi.h, it wouldn''t define DS_PEN or the rest if _WIN32_WINNT wasn''t defined, or something like that...

Just out of curiousity, why is that condition there? And by declaring _WIN32_WINNT myself, is there danger of opening new errors down the road?

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!