• Advertisement
Sign in to follow this  

Convert HRESULT into error string?

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

Hi, im using some COM functions (mainly directshow) and i want to know how i can convert a FAILED() HRESULT into an error string? Would prefer a Windows API / COM function instead of relying on a DirectX function though because its for an Exception class. Cheers

Share this post


Link to post
Share on other sites
Advertisement
Hi,

You can't use a Win32 function to get the error string from a DirectShow HRESULT. You'll have to use whatever DShow gives you to get the corresponding error string. (and it seems they don't provide much information about this). I guess you'll have to write them by yourself :/

Regards,

Share this post


Link to post
Share on other sites
Nah.. Just use the dxerr9.h/lib and use the funcs in there i guess.

DXGetErrorString9
DXGetErrorDescription9

Share this post


Link to post
Share on other sites
There's a handy utility that comes with MSVC called Visual C++ Error Lookup, and you can look up HRESULT return codes there. I don't know if it also includes DX codes, butsupposedly you can add modules for it to search for error strings. I haven't played with it that much.

Share this post


Link to post
Share on other sites
Hmm, was trying to get away from requiring a specific DirectX version to be bundled with the software. Oh well, think ill have to go with the DXGetErrorString9.

Cheers

Share this post


Link to post
Share on other sites
I never looked into that, but as there is a .lib to include i'd say you don't need directx installed for it to work. All it does is map numbers to strings anyway.

Share this post


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

  • Advertisement