🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

GetDC() with DX surfaces

Started by
3 comments, last by GameDev.net 24 years, 7 months ago
First piece of info:
The DirectX return values are COM HRESULT's, so you need to realize they are 32 bit values divided into 3 fields. The High bit is the Severity (SUCESS of ERROR), the next 15 bits are something related to which group (of COM classes) you are in, and the LOW WORD is the value you are looking for, the specific code for the message. So use the Windows macro LOWORD() to get this value, and treat is as an UNSIGNED value. This can then be matched to the errors in the header files.

I don't have any books or code where I am, so I can't answer your specific question. Sorry

Advertisement
The particular error you have is code number 585, which can be calculated manually using windows calculator. Here's the skinny: Type in the error (don't forget the sign) then convert to hex view. retype the last 4 hex digits and switch back to decimal, neat trick eh This kinda trick was very usefull for ASM Debugging back in the day
Thanks... for some reason it works now, although I'm bill gates if I understand why... and it wasn't merely a reboot that was needed since this has plagued me for a week now. :P
I've been using DX (specifically DDraw) casually for many of my small programs, I recently attempted to use TextOut() to display text using dx (after calling GetDC()). When it didn't work I checked the GetDC() return code which turns out to be -2005532087. Now this doesn't match any DDERR's that I know and the wierdest thing is that the ddraw samples in the dx6sdk use GetDC() fine even though they have a setup that has no obvious differences (at least not to me :P )

Any help, advice, flames, etc. would be appreciated.

straight from ddraw.h:

/*
* Windows can not create any more DCs, or a DC was requested for a paltte-indexed
* surface when the surface had no palette AND the display mode was not palette-indexed
* (in this case DirectDraw cannot select a proper palette into the DC)
*/
#define DDERR_CANTCREATEDC MAKE_DDHRESULT( 585 )

This topic is closed to new replies.

Advertisement