Click to See Complete Forum and Search --> : Interesting problem


bill brave
August 24th, 2001, 03:45 AM
I have MDI application generated by VB Wizard.
While typing text on child form, I use timer to calculate a long task.

Problem is : when timer starts its calculation, Child form is freezed untill timer finishes its job so I can not type.

Anyone can help me to solve this problem that I can type as normal when timer doing its job.

I am thinking about using activeX document to create a out-of-process activeX. Is it a correct solution ?

Thank you in advance.

Cakkie
August 24th, 2001, 03:57 AM
That activeX-out-of-process stuff won't help. VB is single threaded, and in this case, you need more then one thread.

What you can do is use DoEvents while calculating the stuff. This will return control to the app, and prevents it from freezing. This is very hand when looping.


' this will freeze your app
for t=1 to 100000
a = a + 1
next t

'This doesn't freeze your app
for t=1 to 100000
a = a + 1
DoEvents
next t




Tom Cannaerts
slisse@planetinternet.be

Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook