Archived

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

ddraw error code 1 ????

This topic is 6584 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

DDraw returns HRESULT's. It's a COM thing, not just a DirectX thing.

"1" would be S_FALSE, which is a "success" code (0x00000001). As far as all errors being negative numbers, I guess you could look at it that way. The highest bit will be 1 on errors. I look at them in hex in the debugger (maybe that's where you are talking about).

Not sure how you're getting S_FALSE out of those calls...

You should really be using the macros SUCCEEDED and FAILED to determine success and failure. Don't just assume success means getting back S_OK.

Are you using VC++?

-Kentamanos

[This message has been edited by Kentamanos (edited December 02, 1999).]

Share this post


Link to post
Share on other sites
im using ms vc++ but im a newbie in programming c++ and the vc++ dev studio. so i dont know exactly how to use the debugger. in fact of this i printout the errorcodes using a errorlog file on my harddrive. this works very well

my code looks like this:
if(HRESULT err=(lpdd->CreateSurface(&ddsd,&lpdds_scroll,NULL)) != DD_OK)
{
CreateErrorLog("error:",err);
return(0);
}

after this "err" has the value of 1
so why and what mean it... my code doesnt run on any other mashine than my

where can i get a list of all errorcodes VALUES and not the definenames such as DD_OK

can you send me an example of using SUCCEEDED and FAILED

thanks for all
elmo

Share this post


Link to post
Share on other sites

if( FAILED(HRESULT err=(lpdd->CreateSurface(&ddsd,&lpdds_scroll,NULL))) )
{
CreateErrorLog("error:",err);
return(0);
}

That should work better, (I just hope it aligns nice in the window:P)

Share this post


Link to post
Share on other sites
The retun code 1 is DD_OK, with your code you have somehow trapped yourself. If you want to include many things in a if-clause you should use ( and ) to make it easier to read for you and you force the compiler to do what you wanted it to do.
Try it with the post of Atavista, or try this
HRESULT err;
if((err=(lpdd->CreateSurface(&ddsd,&lpdds_scroll,NULL))) != DD_OK)

-> Aidan

Share this post


Link to post
Share on other sites
thanks for all your help! it works now!
now i get real negativ errorcodes... so thats all what i want. the only problem is now to find the full errordiscription using the errorcode number i get from the routines.

i think in ddraw.h i can get those numbers and defines - or is there a better way?

elmo

Share this post


Link to post
Share on other sites
hello!
can anybody out there tell me why i get an errorcode value 1 from ddraw ????
i remember that ddraw always returns negativ values if an error occured - so whats that?
this all happens using createsurface and bltfast

thanks for any help
elmo

Share this post


Link to post
Share on other sites