Jump to content

  • Log In with Google      Sign In   
  • Create Account


"FAILED(ddrval)" or "ddrval==DD_OK"


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
2 replies to this topic

#1 SikCiv   Members   -  Reputation: 122

Like
Likes
Like

Posted 07 December 1999 - 04:17 AM

I havnt had any instances, but is 'FAILED(ddrval)' better to use than 'ddrval == DD_OK" when checking for DirectX return errors?



Sponsor:

#2 mhkrause   Members   -  Reputation: 122

Like
Likes
Like

Posted 06 December 1999 - 05:36 PM

Yes, FAILED and SUCCEEDED are preferred over checking against DD_OK, or S_OK. This is because it is possible for COM interfaces to return multiple success values.



#3 Dave Astle   Senior Staff   -  Reputation: 2305

Like
Likes
Like

Posted 07 December 1999 - 04:17 AM

Using the FAILED/SUCCEEDED macros is definitely the preferred method. I've occasionally heard the argument that they are slower than the check for == DD_OK; however, here's the definition of the macros:

code:

#define SUCCEEDED(Status) ((HRESULT)(Status) >= 0)
#define FAILED(Status) ((HRESULT)(Status)<0)

Since macros are inserted before compilation, there shouldn't be any speed decrease doing it this way.

- Dave





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