Re: Error Handlers for VB6
From: YYZ (none_at_none.com)
Date: 03/23/05
- Next message: Cindy Winegarden: "Re: Connecting to a FoxPro Database - VB6 on WindowsXP"
- Previous message: Larry Serflaten: "Re: Error Handlers for VB6"
- In reply to: Larry Serflaten: "Re: Error Handlers for VB6"
- Next in thread: Ken Halter: "Re: Error Handlers for VB6"
- Reply: Ken Halter: "Re: Error Handlers for VB6"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 23 Mar 2005 11:10:06 -0600
"Larry Serflaten" <serflaten@usinternet.com> wrote in message
news:eGjd5U8LFHA.4092@tk2msftngp13.phx.gbl...
>
> A clever fix is to create a class that you instantiate at the start of
> your routine.
> No matter how you exit that routine, VB will drop the reference to that
> class
> as it exits. You can use that fact to your advantage....
<snip>
> Private Sub Form_Click()
> Dim Cursor As HourGlass
> Set Cursor = New HourGlass
> ' Any and all code....
> MsgBox "Waiting..." 'to see it was set to HourGlass
> End Sub
That's nice. A question, though. I have stayed away from use dim X as New
Something in the past because I lose control of when VB creates an
object...and I can't set it to nothing because it will just be created again
if any code references it...
But in this case I think that this might not be an issue, and using Dim
Cursor as New HourGlass would make it a one-liner (Go Rick!) and eliminate
the possibility that I might forget the Set line.
Can you think of any reason why using Dim as New would be bad in this
situation?
Matt
- Next message: Cindy Winegarden: "Re: Connecting to a FoxPro Database - VB6 on WindowsXP"
- Previous message: Larry Serflaten: "Re: Error Handlers for VB6"
- In reply to: Larry Serflaten: "Re: Error Handlers for VB6"
- Next in thread: Ken Halter: "Re: Error Handlers for VB6"
- Reply: Ken Halter: "Re: Error Handlers for VB6"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|