|
-
March 13th, 2001, 10:24 PM
#1
Problem with Timer Control
Hi Codegurus,
I am facing a weird problem with the timer
control of VB.
I have a VB form which has the timer in it. The
timer is set to 5 seconds interval. When this
5 sec expires, the Timer() method is called by
the VB framework automatically.
The Timer() method has a COM server method call
in it. So every 5 seconds the server method call
should take place.
If I run the application in the debug mode (by
pressing F5 button from the VB Design menu),
there is no problem; but if I compile the EXE
and run it from the desktop, the timer function
fires only once. The entire Form freezes after
this and there is no response on the Form.
Just for information:
- The COM object is instantiated using
CreateObject()
- I am running this application on
Windows 2000
- The server side code is written in VC 6.0.
I have used the ATL COM wizard for building
the class and the interface (i.e. the skeleton
code)
What could be the reason for this? If this is a
VB bug, please suggest a workaround. This is
really URGENT!!!!!
Thanks in advance,
With best regards,
Sayan
Sayan Mukherjee
Calcutta (INDIA)
Email: [email protected]
-
March 14th, 2001, 06:58 AM
#2
Re: Problem with Timer Control
Maybe a DoEvents within the Timer() event handler works for you.
-
March 14th, 2001, 07:07 AM
#3
Re: Problem with Timer Control
I wouldn't advise that - what happens if the timer fires whilst it is still processing the last firing and gets to the doevents()? Probably "out of stack space".
-------------------------------------------------
Ex. Datis: Duncan Jones
Merrion Computing Ltd
http://www.merrioncomputing.com
-
March 15th, 2001, 07:39 PM
#4
Re: Problem with Timer Control
The timer function should not fire before it
has finished processing the last firing. The
time count down starts all over only after
the TimerName.Timer() method returns.
So if the timer is enabled, there has to be at
least a finite time gap between two successive
calls to the TimerName.Timer() method.
However I found a work around to my problem.
I registered my server dll again and everything
was fine! I don't know what went wrong. I am
still apprehensive that the code can give
problems when it runs in the MTS.
Please throw some light on the problem. I would
like to be preventive rather than be sorry later!
With best regards,
Sayan
Sayan Mukherjee
Calcutta (INDIA)
Email: [email protected]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|