Solved

Timesharing - getting multiple routines to run at once

Posted on 2001-06-04
4
162 Views
Last Modified: 2010-05-02
I have a MDI application. Each child form has it's own routines. after starting a routine on one form and then starting another routine on another form, the first form routine quits or locks up. I would like to time share between the two. How can I do this - run multiple routines at once?
0
Comment
Question by:Spikeman
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 7

Expert Comment

by:Z_Beeblebrox
ID: 6153347
The easiest way is to put DoEvents all over the place. This will give you quasi time slicing. A better way may be to use out of process ActiveX exe's. It may also be possible to multi-thread your application but I have no idea how.

Zaphod.
0
 
LVL 22

Accepted Solution

by:
rspahitz earned 50 total points
ID: 6153519
The easiest way to achieve "time-slicing" or multitasking within a VB app is to add a timer control for each task.

Activate the timer and it runs in its own thread, thereby allowing you to process whatever is in the Timer event procedure.

If you then activate another timer, you can run another thread.

The DoEvents mention in a previous comment would be useful if the thread is doing a large amount of processing, typically inside a loop.
0
 

Author Comment

by:Spikeman
ID: 6154210
Thank you. I have timers currently in my code but since I'm monitoring com ports for data it makes putting my routines in a timer difficult as I'm triggering off of the MScomm_Oncomm event. Thanks again!
0
 

Author Comment

by:Spikeman
ID: 6154215
Thank you. I do have doevents all over but since I was using the MScomm_Oncomm event to trigger on Com port inputs it kept the focus tied up there. I should of mentioned this in my question. Thanks again.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Suggested Courses
Course of the Month10 days, 4 hours left to enroll

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question