You could think all values with 0x80000000 set is an error. In C++,
FAILED() macro is the one you should rely on.
#define FAILED(Status) ((HRESULT)(Status)<0)

In C#, you could write the same logic, or call
Marshal.ThrowExceptionForHR(), which throws appropriate exception for
the value, or simply returns if hr is non-error value.

-----Original Message-----
From: dotnet discussion [mailto:[EMAIL PROTECTED]] On Behalf Of
Erick Thompson
Sent: Tuesday, May 21, 2002 10:00 AM
To: [EMAIL PROTECTED]
Subject: Re: [DOTNET] RCW for IFilter and LoadIFilter

Mattias,

Thanks for your response.  Comments inline.


> >What I'm confused about is the order of the bits. I am getting a
hresult
> >of -2147467259, which is a bit pattern of 1 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0
> >0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 1.

> That's the standard error code E_FAIL (0x80004005) defined in
Winerror.h.
> > From the header comments above, it looks like the severity is 10
(warning).

So if the result is E_FAIL, but the severity is a warning, does that I
can
continue processing, so should I abort the process, or continue?

> Why do you want to OR it?

My mistake, I want to AND it. If I am going to continue on a warning, I
would assume that I would do

if ((hResult & 0x07FFFFFFF  )>0)

I guess I'm just not sure how to interpret various hresults, and
documentation isn't very verbose on this.

Thanks,
Erick

You can read messages from the DOTNET archive, unsubscribe from DOTNET,
or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to