Re: Error Handlers for VB6

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: Bob O`Bob (filterbob_at_yahoogroups.com)
Date: 03/23/05


Date: Wed, 23 Mar 2005 14:56:13 -0800

Larry Serflaten wrote:

> 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....
>
> ' [HourGlass Class code]
> Private Sub Class_Initialize()
> Screen.MousePointer = vbHourglass
> End Sub
>
> Private Sub Class_Terminate()
> Screen.MousePointer = vbDefault
> End Sub

I generally save the previous MousePointer value in an
instance variable, and restore that value on Terminate.

That way I can nest calls to other routines which might
create a WaitCursor (my usual name for the class) and
only the outermost will set it back.

        Bob



Relevant Pages

  • Re: Error Handlers for VB6
    ... >> pointer is still an hour glass. ... > sure all exits go through that one exit point. ... your routine. ... > Private Sub Class_Initialize ...
    (microsoft.public.vb.database.ado)
  • Re: Error Handlers for VB6
    ... sure all exits go through that one exit point. ... A clever fix is to create a class that you instantiate at the start of your routine. ... Private Sub Class_Initialize ... it will set the mousepointer to an hourglass. ...
    (microsoft.public.vb.database.ado)
  • Re: [PATCH RFD] alternative kobject release wait mechanism
    ... exit() routines will have to ... exit routine, but to make things work the routine would have to wait for ... The goal of immediate-disconnect is to remove such lingering reference ... If you unregister from all layers a device ...
    (Linux-Kernel)
  • Re: Combo box drop down list
    ... I have used the "calc on exit" to populate a reference. ... Private Sub Document_Open ...
    (microsoft.public.word.vba.general)
  • RE: Error 2455 on close of db
    ... occurs when you exit this form in this way. ... I do have a split db with a hidden form that opens when the database does to ... Private Sub Form_Unload ...
    (microsoft.public.access.formscoding)