Getting HRESULT error codes

  • Thread starter Thread starter José Luis Lombana Aramendía
  • Start date Start date
J

José Luis Lombana Aramendía

Hi all,

When exposing a .NET assembly as a COM object (and consumed by Visual Studio
6), any framework internal error is
exposed as a HRESULT with values 0x80131900 thre 0x80131AFF:

/*********************************************************************

** **

** CorError.h - lists the HResults used by the .NET Framework's **

** Common Language Runtime. **

** Created: September 3, 1999. **

** **

*********************************************************************/



#ifndef __COMMON_LANGUAGE_RUNTIME_HRESULTS__

#define __COMMON_LANGUAGE_RUNTIME_HRESULTS__

//

// ATTENTION: Range 0x1900 - 0x1AFF is reserved for Framework errors

// Range 0x1B00 - 0x1BFF is reserved for MD Validator errors (see above
VLDTR_E_...)

//

#endif // __COMMON_LANGUAGE_RUNTIME_HRESULTS__


When we try to catch one of those errors in a _com_error object, we get an
obscoure message
"Unknown error 0x8013....". Is there a list with all of those Framework
errors?. If so, is there a
way to get a more descriptive message about the error?.

Thanks in advance.
 
Hi,

You can provide custom HRESULTs by creating a custom
ApplicationException-derived class and initializing the protected HResult
property to the desired value.

--
Sincerely,
Dmitriy Lapshin [C# / .NET MVP]
Bring the power of unit testing to the VS .NET IDE today!
http://www.x-unity.net/teststudio.aspx

"José Luis Lombana Aramendía"
 
Back
Top