Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


ddraw error code 1 ????


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
6 replies to this topic

#1 elmo   Members   -  Reputation: 122

Like
Likes
Like

Posted 06 December 1999 - 08:22 AM

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


Sponsor:

#2 Kentamanos   Members   -  Reputation: 122

Like
Likes
Like

Posted 02 December 1999 - 05:09 AM

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).]


#3 elmo   Members   -  Reputation: 122

Like
Likes
Like

Posted 03 December 1999 - 05:41 AM

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


#4 Atavist   Members   -  Reputation: 122

Like
Likes
Like

Posted 03 December 1999 - 06:56 AM


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)


#5 Aidan   Members   -  Reputation: 122

Like
Likes
Like

Posted 03 December 1999 - 11:47 AM

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


#6 elmo   Members   -  Reputation: 122

Like
Likes
Like

Posted 04 December 1999 - 01:24 AM

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


#7 Strabbi   Members   -  Reputation: 122

Like
Likes
Like

Posted 06 December 1999 - 08:22 AM

I just learned about the D3DXGetErrorString function myself. It gives an error string from the HRESULT number.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS