Program execution.

Posted on 2002-04-17
Last Modified: 2010-05-02
I want to have one part of my VB6 program running with a cycletime of 10 seconds and with higher priority then other parts.

If I am using Common dialog or a Message box then my whole application holds until the input is done.

Do I have to split my program into two programs or can I make interuption of the Common dialog and Message boxes.
Question by:sek
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

Accepted Solution

skhorshid earned 50 total points
ID: 6947902
You need threading, It can be done in VB6 but its messy and impossible to debug.  I suggest you use,  or another programming lang.

If you really want to use VB6 then you can look at

there are probably many examples at


Expert Comment

ID: 6948002
There are other methods you can use.  You can create an asyncronous ActiveX EXE file that will work the Timer, or you can create a MsgBox with a form.

Not too sure about the Common Dialog, though I don't believe you can interrupt it.

Maybe someone else has a better answer.


Expert Comment

ID: 6948196
I think you should split your program.
One to capture user’s input and save it to a file or access database.
and another one to read it and process.

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.


Expert Comment

ID: 6955751

For the message part of your program, you may want to create a new form simply to pop up a message without pausing your program.

For the commondialog part of your program, you could simply use the common dialog apis to handle that.  Simply set the handle to 0 for the parameters in the API and it'll not disturb your program at all unless your program works in such a way:

' your coding that needs immediate attention without pausing
'call commondialog
' your coding that needs immediate attention without pausing

If the above method is how your program is programmed, you may want to use a timer to fire that comondialog event and end the timer after use.

Here's a file for you over the net to help you with the API part:

Description: To make it easy to use the common dialog through API calls. This saves on program sizes over using the common dialog OCX. Also no need for OCX to be registered since calls all done directly through API.

Anyway, there's another advantage to using APIs - you do not need to include your ocx files when exporting your proggy to other PCs.

That's it!

glass cookie : )
LVL 49

Expert Comment

ID: 7660429
Hi sek@avtech,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept skhorshid's comment(s) as an answer.

sek@avtech, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
DanRollins -- EE database cleanup volunteer

Expert Comment

ID: 7755137
per recommendation

Community Support Moderator @Experts Exchange

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

734 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