
Problems w/handling HRESULT returned from a DLL
Can anyone explain how the HRESULT can be handled in VB 5 returning from
a DLL? I am getting a number that probably represents a layout of
a HRESULT but I do not know how to "decode" it.
I know that HRESULT is a 32 bit return value that must be "decoded".
If I just use Boolean, its always true (since its greater than 0).
If i use integer I see 28160 (ie 00010111 00000000) when it should be true.
28161 (IE 00010111 00000001) when it
should be false.
I can fake the system by subtracting the result from 28160. This causes TRUE
(0) and
FALSE (-1) when it should, but am I just fooling myself?
if i use long, results are unpredictable.
PS. I have no source code for this DLL, but is used successfully from
Delphi.
Any ideas? Thanks.