Convert HRESULT into error string?

Started by
4 comments, last by Endurion 19 years, 3 months ago
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
Mark Ingramhttp://www.mark-ingram.com
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,
Nah.. Just use the dxerr9.h/lib and use the funcs in there i guess.

DXGetErrorString9
DXGetErrorDescription9

________________________________pro.gram.mer - an organism that turns caffeine into code
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.
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
Mark Ingramhttp://www.mark-ingram.com
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.

Fruny: Ftagn! Ia! Ia! std::time_put_byname! Mglui naflftagn std::codecvt eY'ha-nthlei!,char,mbstate_t>

This topic is closed to new replies.

Advertisement