Is there a function in win API which can be used to extract the string representation of HRESULT value?
The problem is that not all return values are documented in MSDN, for example ExecuteInDefaultAppDomain() function is not documented to return “0x80070002 – The system cannot find the file specified.”, however, it does! Therefore, I was wondering whether there is a function to be used in common case.
You can use _com_error:
If you don’t want to use
_com_errorfor whatever reason, you can still take a look at its source, and see how it’s done.Don’t forget to include the header
comdef.h