At a certain moment an EOleSysError occurs and the errorcode of that exception is an HRESULT. Is there a way where I can turn that HResult back into an errorcode or string?
A HRESULT already is an error code. Its meaning depends on the call that was made. In COM, HRESULTs are returned, because exceptions are not allowed. To work around that, it is common to call OleCheck
, which checks a HRESULT and raises and exception if it is a value other than S_OK
. That is the EOleSysError you are getting. :)
Note however, that HRESULT is already an error code. HRESULT is just an integer. The name is misleading, because the H
suggests it is a handle, but it is not.
So there isn't any more information than you have now. The HRESULT value, combined with the documentation of the API you are calling, should give you all the details you need.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With