on 10-12-2005 12:55 PM
Hi,
How can we add a timer to refresh a UDO form periodically?
Data are updated by multiple users into the DB round the clock. A UDO form is used to consolidate the data so, we need to refresh the form every 5 mins to get updated info.
I am using VB and 2004B. Your help is needed. Thanks.
Rowdy,
I am using VB6 and not really sure can VB6 do multi-threading. Please let us know if you have leads to where can I find sample codes to accomplish the auto refresh.
Jaro,
I will try out your method as well.
Thanks, guys.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is one of the first results from google with keywords "vb6 thread"...
http://www.freevbcode.com/ShowCode.Asp?ID=4029
Hope it helps...
Grtz, Rowdy
It may not be possible but, any suggestion will be helpful.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
here's my idea:
what about adding a check into some loop, which is always running, while the addon is active ...
try putting it into the "SubMain" - "SubMain.bas" in your project
there should be something like as
Do While GetMessage(Msg, 0&, 0&, 0&)
TranslateMessage Msg
DispatchMessage Msg
DoEvents
Loop
and add there some function to "get time" compare it with last update ... and if neccessarry, initiate update of the form ...
Don't know if it will work ... but ... it might ... because whenever I do pause addon, it stays in the loop ...
Jaro
Sure it's possible... Just make a multithreaded application...
One thread (the mainthread) for your add-on, and one thread that peridocally updates that form. When the form is opened, create a new thread and give the formUID as parameter. Whit that, create a while(true) loop. In that loop update the form, and then sleep the thread for 300000ms (=5x60x1000, is 5 minutes). So as long as that thread lives, it will try to update the form.
When you close the form, just kill the tread and your fine...
We did something simular a few years ago...
I don't know the right syntax now, but Google has your answer... Just search for code samples with multithreaded as subject for vb(.NET). (Just threads and vb(.NET), it's not a really SBO issue)
Hope it helps! Grtz, Rowdy
User | Count |
---|---|
98 | |
11 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.