Solved

Program execution.

Posted on 2002-04-17
6
203 Views
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.
/SEK
0
Comment
Question by:sek
6 Comments
 
LVL 2

Accepted Solution

by:
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 VB.net,  or another programming lang.

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

http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=27481&lngWId=1


there are probably many examples at www.planetsourcecode.com

 
0
 
LVL 4

Expert Comment

by:RichW
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.

RichW
0
 
LVL 5

Expert Comment

by:rkot2000
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.

0
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
LVL 8

Expert Comment

by:glass_cookie
ID: 6955751
Hi!

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:

Donload...
http://www.planetsourcecode.com/vb/scripts/ShowZip.asp?lngWId=1&lngCodeId=21344&strZipAccessCode=ODE%5F213440422
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 : )
0
 
LVL 49

Expert Comment

by:DanRollins
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
0
 

Expert Comment

by:SpideyMod
ID: 7755137
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

786 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