• Advertisement
Sign in to follow this  

HRESULT error checking

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

Hey all, I've read multiple posts about HRESULT returns for error checking. And I've done pretty much all of it. I'm still only getting an integer value for my return value. I put this in my watch: --> hres,hr -2005530516 HRESULT As you can see, i'm still getting the numerical value instead of a string. Is there a list of all the return values as an enum or something I can put in a swtich statement, and just return a string myself? (A list for all Direct3D functions). I have one for DirectDraw functions, which serves no purpose for me :) Thanks, would appreciate some help on this one. -Mario (Edit): hres = m_pD3DSprite->Draw(m_SpriteList[i].d3dTexture, NULL, ¢erPos, &screenPos, ALPHA(a)); if(FAILED(hres)) { MessageBox(NULL, "Failed to draw bitmap using DrawBMP() function", "D3DError", MB_OK); return E_FAIL; } I'm currently doing things such as this. And getting the numerical value for hresult, declared earlier in this post.

Share this post


Link to post
Share on other sites
Advertisement
Have you had a look at the DXGetErrorString9() function? It takes an HRESULT and returns a string pointer to the error string.

There is also the DXGetErrorDescription9() function, which returns a slightly more user friendly text of the return value.


HRESULT hr = SomeDirectXFunction();
if (hr != D3D_OK)
{
CString nErrorText;
nErrorText.Format("SomeDirectXFunction failed: %s - %s", DXGetErrorString9(hr),DXGetErrorDescription9(hr) );
_cputs(nErrorText.GetString());
}


Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Since I'm a guest, because of some problems while registering, I can't make a new thread. And that's why I'm posting here, sorry about that.
I wanna ask if anyone could tell me where to find some tutorials - DirectPlay, DelphiX ?
tnx in advance.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement