Re: VB6 Raise Error w/ Custom Description being replaced w/ desc for e
- From: "Ken Halter" <Ken_Halter@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 26 Jan 2007 10:46:58 -0800
"Robb" <Robb@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:0C7F6A7D-2D89-47FE-BCFD-9C0DF80E1019@xxxxxxxxxxxxxxxx
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"
This seems to work fine... note that you spelled "Raise" wrong above, which
means you're typing code from memory here... which is never a good idea.
It's always best to paste the actual code so we're not spinning our wheels
over a typo.
'====================
Option Explicit
Private Sub Command1_Click()
Dim o As Class1
Set o = New Class1
On Error Resume Next
Call o.TheError
Debug.Print Err.Number
Debug.Print Err.Source
Debug.Print Err.Description
End Sub
'====================
Option Explicit
Public Sub TheError()
Err.Raise 106, "MySource", "My Custom Description"
End Sub
'====================
--
Ken Halter - MS-MVP-VB - Please keep all discussions in the groups..
In Loving Memory - http://www.vbsight.com/Remembrance.htm
.
- Prev by Date: Re: CommonDialog returns wrong context
- Next by Date: Re: VB6 Raise Error w/ Custom Description being replaced w/ desc for e
- Previous by thread: for zilvia: extremely intelligent premium nntp access - afba ahtisog - (1/1)
- Next by thread: Re: VB6 Raise Error w/ Custom Description being replaced w/ desc for e
- Index(es):
Relevant Pages
|