Problems w/handling HRESULT returned from a DLL 
Author Message
 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

Any ideas? Thanks.

Fri, 12 May 2000 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Why VB can not handle the HRESULT ?

2. HRESULT Return

3. Returning a negative HResult

4. HRESULT Return

5. How to return HRESULT

6. OLEDB Returns HResult Error to VB When Using SQL Server 7

7. HRESULT returned value

8. HRESULT returned value

9. PRIVATE DECLARE ... Handling returns (DLL)

10. Help: DLL Function returns handle

11. How to handle a return pointer to an array from a DLL

12. Dll returns a Handle to a DIB how can I display in picture box


Powered by phpBB® Forum Software