Re: VB6 Raise Error w/ Custom Description being replaced w/ desc f
- From: "Tony Proctor" <tony_proctor@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 27 Jan 2007 11:26:29 -0000
According to MSDN, user-defined error numbers should start at
vbObjectError+513 (some very old pages incorrectly say '+512')
The vbObjectError constant is not an error code base. It's actually a bit
mask to apply to the user-defined numbers. VB's runtime reserves the first
512 codes as its own.
Tony Proctor
"Robert Morley" <rmorley@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:evgQQOYQHHA.4832@xxxxxxxxxxxxxxxxxxxxxxx
Is there anything you can think of that differentiates the XP machineyou're
on from other machines where it works? Different language of Windows,others,
low-level apps & debuggers installed on that one that aren't on the
anything of that nature?make
Also, rather than using fixed numbers, you should use the vbObjectError
constant (e.g., Err.Raise vbObjectError + 1, "MySource", "My Custom
Description"), just to be absolutely safe. It doesn't sound like it'll
a difference here, but it's worth a try.lesser
Finally, have a look at this article, it sounds awfully similar to what's
happening to you: http://support.microsoft.com/kb/238082/en-us. Of
relevance, I suspect, there's alsobeen
http://support.microsoft.com/kb/255625/en-us.
Rob (with one "b" <grin>)
"Robb" <Robb@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:68A0D10A-1CF4-48E7-97D3-1CEA935AC63E@xxxxxxxxxxxxxxxx
Mispellings aside, I changed my code to
Err.Raise 550, "MySource", "My Custom Description"
(copied and pasted this time) and I'm still getting the same results. I
got
550 from Help, it's in the user-defined range. The Error Number gets
passed
thru, the custom Description does not.
--
Robb
"Bob O`Bob" wrote:
Robb wrote:
I'm using VB 6.0, Service Pack 6, on an XP machine.
I'm raising an error with a custom Description in a DLL.
Err.Rasie 106,"MySource","My Custom Description"
When the invoking DLL catches the error the custom description has
raised.replaced with the default VB description for the error number I
And
the Err.Source is blank.
Err.Number = 106
Err.Source = blank
Err.Description = Application-defined or Object-defined error
Any ideas as to why my "custom description" is being lost?
You can't pick just any number as if from a hat.
If you simply read the help entry for the Raise method, you'll see.
Bob
--
.
- Follow-Ups:
- Re: VB6 Raise Error w/ Custom Description being replaced w/ desc f
- From: Robert Morley
- Re: VB6 Raise Error w/ Custom Description being replaced w/ desc f
- References:
- Prev by Date: Re: VB6 Raise Error w/ Custom Description being replaced w/ desc f
- Next by Date: Re: VB6 Raise Error w/ Custom Description being replaced w/ desc f
- Previous by thread: Re: VB6 Raise Error w/ Custom Description being replaced w/ desc f
- Next by thread: Re: VB6 Raise Error w/ Custom Description being replaced w/ desc f
- Index(es):