PDA

View Full Version : Calling Multiple Exes at the same time



chandru@080
15th December 2010, 06:08
I want to know how do i call multiple exes at the same time??

Now let me elaborate the issue.

In my application i am creating buttons dynamically from an XML file. Now the xml file also has a field called exename. Along with the button creation the exe associated with the button also has to be initiated. There can be a maximum of 5 buttons so that means 5 exes. I want to know how the exes can be exectuted?

wladek
15th December 2010, 07:12
Hi chandru@080,

Doesn't the QProcess class help?

Hope this helps,
Wladek

chandru@080
16th December 2010, 05:32
I was checking the QProcess::execute function.. it does not pop out the message and waits till the process is over. so i guess that cannot be used. Please correct me if i am wrong. here the issue is all the exes has to be initiated at the same time and the correct exe related to the button has to be displayed when the button is clicked.

ChrisW67
16th December 2010, 06:20
I was checking the QProcess::execute function.. it does not pop out the message

What message?

and waits till the process is over.
Did you actually read any more of the documentation for QProcess beyond the first thing that looked vaguely related? Try QProcess::start() for example.

so i guess that cannot be used. Please correct me if i am wrong.
You didn't specify blocking or non-blocking in your original post so you received the generic QProcess response. You cannot use execute() if you don't want to block. However, there's more to QProcess than that single method.

here the issue is all the exes has to be initiated at the same time and the correct exe related to the button has to be displayed when the button is clicked.
Do you want to start the corresponding executable when the button is clicked (last part of that sentence), all at the same time after some unspecified event (first part of that sentence), or when the button is created (as in your first post)? Your post is confusing in this regard.

chandru@080
16th December 2010, 07:50
For the First Comment- its not the message.. its the exe.

Fot the second Comment - i shall look into Start()

For the third comment - I want to show the exe which is running in the background when the button is clicked.. the exe's has to start when the main window pop up. I hope its clear now.

The button gets created when the main window pops up.

chandru@080
16th December 2010, 10:55
i could open all the exes.. but my next problem is i dont want to display that on the screen. it has to be hidden. only on button click the exe should be displayed.. how can i achieve this?

FelixB
16th December 2010, 11:29
then connect button's "clicked()"-signal with a slot that executes the corresponding exe

ChrisW67
16th December 2010, 22:15
With no information on what the background processes are, what sort of UI they have, or what environment they are running in there is no answer to the question.

The solution will be platform dependent because you want to hide/unhide the UI of other arbitrary processes.