Results 1 to 3 of 3

Thread: Error Handling in VB

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2001
    Posts
    112

    Error Handling in VB

    Hi all,

    I read some books said that microsoft error messages lie in the range of 1 to 65535. Books recommend using vbObjectError + ? to define our own error constants. vbObjectError's value =
    -2147221504.

    Why vbObjectError's value = -2147221504 since microsoft error messages only lies in 1 to 65535?

    Does this mean all user-defined error constants must be negative?

    How can i define my own error constants?

    Thanks!

  2. #2
    Fanatic Member simonm's Avatar
    Join Date
    Sep 2000
    Location
    Devon, England
    Posts
    796
    VB Code:
    1. Public Const err_num1 = vbObjectError + 1
    2. Public Const err_num2 = vbObjectError + 2
    Everything I say is either loose interpretation of dubious facts or idle speculation rooted in irrational sentiment.

  3. #3
    Fanatic Member simonm's Avatar
    Join Date
    Sep 2000
    Location
    Devon, England
    Posts
    796
    By the way, you can define your error codes to be whatever you like, they don't have to negative or even outside of the microsoft range.

    The only problem with that is then you cannot uniquely identify the error from the error number.
    Everything I say is either loose interpretation of dubious facts or idle speculation rooted in irrational sentiment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width