|
-
October 9th, 2001, 09:17 PM
#1
How to run two threads simultaneous?
I perform a computation-intensive calling, and I want to show a progressbar during the executing, but I found that during the execution, timer event is not invoked, How can I do it?
(the DoEvents function doesn't effect.)
Who can help me?
Happy to be a programmer.
-
October 10th, 2001, 01:12 AM
#2
Re: How to run two threads simultaneous?
DoEvents should have effect, but I noticed that in some cases, this does not work the way it should, but so far, I've only seen this behavior in the VB IDE, not in the compiled EXE. So don't mind if the DoEvents comes through only one in a lifetime in the IDE, try compiling it to EXE, run the code, and it should work.
Tom Cannaerts
[email protected]
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
-
October 10th, 2001, 01:21 AM
#3
Re: How to run two threads simultaneous?
Thanks you, Tom.
I think Doevent will work well in my own computation loop. But if I need to request another object which is supplied by the third party, I debug the code, it waits on this statement, and you find System Idole Process occupy the most machine resource. I think it's easy to do it in VC++, but how to do it in VB?
I am confuse about how VB control thread.
Happy to be a programmer.
-
October 10th, 2001, 02:01 AM
#4
Re: How to run two threads simultaneous?
Let's just say there is NO (good) way to control threads in VB, it just isn't there. This means we will olways have to wait for our previous statement to complete, including calls to third-party controls. One light in the darkness is that VB.Net (VB7) will have multithreading capabilities, and even quite good and easy ones, only, that's nothing that's going to help us now right?
Tom Cannaerts
[email protected]
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
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
|