Re: Writing a "clean" Timer Callback Routine
From: alpine (alpine_don'tsendspam_at_mvps.org)
Date: 02/25/04
- Next message: Howard Kaikow: "Re: VB6 vs VB .Net"
- Previous message: George Ionescu: "Re: VB dll can export function and call it from VC?"
- In reply to: Marrow: "Writing a "clean" Timer Callback Routine"
- Next in thread: Larry Serflaten: "Re: Writing a "clean" Timer Callback Routine"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 25 Feb 2004 00:10:51 -0700
On Wed, 25 Feb 2004 06:54:55 GMT, "Marrow" <no@spam.com> wrote:
>I'm no VB expert, so please bear with me if any part of the following shows
>my lack of experience with VB.
>
>I'm using timeSetEvent to generate a fairly precise periodic delay in an
>application. Once the timed event occurs, I would like to perform some
>actions on a set of data and controls which are present on a form (Form1).
>I am having problems writing a "clean" timer callback routine to do this.
>Here is my problem:
>
>The timer callback routine for timeSetEvent cannot be in a class module, it
>must be in a .bas module. I would like to raise an event or sub on Form1
>from within the timer callback routine to perform the necessary actions on
>the controls and data on Form1. However, since events may only be raised
>within the module in which they are declared, it looks like that is not
>possible. The timer callback routine in the .bas module cannot raise an
>event on Form 1. Therefore, based on my current understanding of VB, it
>seems my only option is to make 'public' any variables, objects, or controls
>on Form 1 which I want to operate on, and then perform the actions upon them
>within the timer callback routine itself. As you can imagine, using
>'public' objects in this way quickly makes the code very ugly.
>Unfortunately, I haven't yet come up with any other solution.
>
>Is there a cleaner solution to this problem?
>
>Thanks in advance for any help.
You might want to have a look at the Resolving Pointers example at
http://www.mvps.org/vbvision/
HTH,
Bryan
____________________________________________________________
New Vision Software "When the going gets weird,"
Bryan Stafford "the weird turn pro."
alpine_don'tsendspam@mvps.org Hunter S. Thompson -
Microsoft MVP-Visual Basic Fear and Loathing in LasVegas
- Next message: Howard Kaikow: "Re: VB6 vs VB .Net"
- Previous message: George Ionescu: "Re: VB dll can export function and call it from VC?"
- In reply to: Marrow: "Writing a "clean" Timer Callback Routine"
- Next in thread: Larry Serflaten: "Re: Writing a "clean" Timer Callback Routine"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|