Custom HRESULTs question. 
Author Message
 Custom HRESULTs question.

I have adopted the HRESULT for many of my functions return values.  I have -
relunctant to mention - used the standard ones only.  I thought that I
should make use of custom HRESULTS and was wondering if I can customize the
facility codes.  Do I use the FACILITIES_WINDOWS as a base and increment
from that like you would with windows messages?  Do you have any other
suggestions.

Thanks so much for all of your expert input!!!!  This newsgroup is great!

Demir



Sun, 03 Apr 2005 05:30:18 GMT  
 Custom HRESULTs question.
Custom HRESULTs should use FACILITY_ITF with the error code proper being
in 0x200-0xFFFF range
--
With best wishes,
    Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken


Quote:
> I have adopted the HRESULT for many of my functions return values.  I
have -
> relunctant to mention - used the standard ones only.  I thought that I
> should make use of custom HRESULTS and was wondering if I can
customize the
> facility codes.  Do I use the FACILITIES_WINDOWS as a base and
increment
> from that like you would with windows messages?  Do you have any other
> suggestions.

> Thanks so much for all of your expert input!!!!  This newsgroup is
great!

> Demir



Sun, 03 Apr 2005 05:54:53 GMT  
 Custom HRESULTs question.

Quote:

> I have adopted the HRESULT for many of my functions return values.  I have -
> relunctant to mention - used the standard ones only.

When the state is properly described by one of the standard HRESULT
values, that is appropriate.

Quote:
> I thought that I
> should make use of custom HRESULTS and was wondering if I can customize the
> facility codes.  Do I use the FACILITIES_WINDOWS as a base and increment
> from that like you would with windows messages?  Do you have any other
> suggestions.

I believe typically FACILITY_ITF is used.  I believe FACILITY_WINDOWS
is used for Windows GetLastError values translated into failure
HRESULTs.

Note that the it is recommended that the first 200 (IIRC) numbers in
FACILITY_ITF not be used.

--
Craig Powers
MVP - Visual C++



Sun, 03 Apr 2005 05:55:29 GMT  
 Custom HRESULTs question.

Quote:
> Note that the it is recommended that the first 200 (IIRC) numbers in
> FACILITY_ITF not be used.

First 0x200 actually.
--
With best wishes,
    Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken



Sun, 03 Apr 2005 06:10:52 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Unable to add custom C# control to a form - Exception from HRESULT: 0x80131019

2. custom HRESULT in MSSOAP toolkit revisited.

3. custom HRESULT decoding to error message

4. Custom HRESULTs

5. Custom HRESULTS

6. problem with custom HRESULTS

7. HRESULT Question.

8. Question: VB, ATL and HRESULT?

9. ATL and custom "static HRESULT WINAPI UpdateRegistry(BOOL bRegister)"

10. ASP.NET user control custom designer question

11. ASP.NET user control custom designer question

12. Quick question on custom error messages w/ Error() macro

 

 
Powered by phpBB® Forum Software