ddraw error code 1 ????

Started by
5 comments, last by elmo 24 years, 4 months ago
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).]

-Kentamanos
Advertisement
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


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)

Just because the church was wrong doesn't mean Galileo wasn't a heretic.It just means he was a heretic who was right.
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

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

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

I just learned about the D3DXGetErrorString function myself. It gives an error string from the HRESULT number.
--If Train A leave San Francisco at 8:30am EST travelling 25mph and Train B leaves Chicago at 1:30pm MST travelling at 40mph, and they're 3000 miles apart when they start, what is the capital of Bulgaria?

This topic is closed to new replies.

Advertisement