Section 11.4. Error Constants


11.4. Error Constants

The sample code in the previous section demonstrated the Err.Raise method being used for custom error reporting. Since .NET already uses this same method to indicate predefined system errors, there needs to be some way to confirm that your code's custom error numbers do not conflict with system-defined error numbers. Visual Basic defines a constant, vbObjectError, that assists in the selection of custom error-code values. This constant represents the minimum error code you should use for your own custom error messages. The recommended range is from vbObjectError to vbObjectError + 65535. If your application interacts with COM components, you should start your error codes with vbObjectError + 512, since COM components often use the first 512 values in this range for their own error codes.




Visual Basic 2005(c) In a Nutshell
Visual Basic 2005 in a Nutshell (In a Nutshell (OReilly))
ISBN: 059610152X
EAN: 2147483647
Year: 2004
Pages: 712

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net