Hi William,
I think the exception message is more readable than numeric.
In Windows, the getlasterror() function will get the error number, but it
isn't convinient,
so FormatMessage() function is provided to translate the error number into
readable message.
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! -
www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
--------------------
| From: "William Stacey" <
[email protected]>
| Subject: Exception errorcodes?
| Date: Fri, 15 Aug 2003 11:08:32 -0400
| Lines: 12
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.3790.0
| X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Message-ID: <#
[email protected]>
| Newsgroups: microsoft.public.dotnet.languages.csharp
| NNTP-Posting-Host: 66.188.59.114.bay.mi.chartermi.net 66.188.59.114
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:176684
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| Wouldn't it be better if you could throw one of the prebuilt exceptions,
| such as ApplicationException or ArgumentNullException, and also supply a
| numeric errorcode with it. Then the users can check that instead of the
| text message. I know you can create your own exceptions, but this would
fit
| most situations without the need to create new classes. Or maybe you can
| already?
| TIA
|
| --
| William
|
|
|