473,378 Members | 1,536 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Transfering control when using system()?

Hi,

I'm writing a GUI interface for a program that executes from the
command line in Unix. I've used system("command..") to do it, and it
all works fine. However, the problem is that the ideal behaviour would
be for the GUI to disappear once the program starts to run. I know
that all system() does is call up the command procesor and execute the
command before passing control back to the origin program (in my case
the GUI), but I need the GUI to pass control completely to the program
and just exit so that closing the GUI won't close the program as well.
Is this possible with system(), or any other method in C++? My GUI is
written using the Qt library.

Thanks for any help!

Jenny.
Jul 23 '05 #1
2 1026
What about something like this?:

int main() {
// ...qt code goes here
if (fork() == 0) {
// close/clean up GUI
} else {
system(whateverCmd);
}
return 0;
}

My main concern would be that the GUI would get cleaned up twice.
Surely the Qt designers have had other users attempt this, so surely
there's a sane way to handle it.

Hope this helps!
-Ryan King (rk***@panoptic.com)

Jul 23 '05 #2
Jenny wrote:
Is this possible with system(), or any other method in C++? My GUI is
written using the Qt library.


Why not use QProcess then?

Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Niyazi | last post by:
Hi, I have BIG question and I gues it is the BEST question. I have a problem that I am guessing the best solution is to create some sort ..NET Services. This Service(s) must check every...
9
by: Guy | last post by:
I have extended the datetimepicker control to incorporate a ReadOnly property. I have used the new keyword to implement my own version of the value property, so that if readonly == true then it...
2
by: bernardpace | last post by:
Hi, I am writing a client server application using TcpClient and TcpListener classes. Now I need to transfer structured large amounts of data. I was thinking to transfer the data in an xml...
2
by: Piotr Karwatka | last post by:
Hi! I have a little problem an qeustion. In .NET Windows Forms I can do something like that: - i have forms - Form1 Form2, on first form i have TextBox1 control on 2nd form I have Button1...
2
by: Ben | last post by:
I used the following code to transfer some web control data from Page1.aspx to Page2.aspx. It is successful to get the TextBox.Text over, but the DropDownList data failed to appear in Page2. I...
14
by: Adrian Parker | last post by:
For deployment reasons, we don't want to have to install our large app on each network client manually; we'd like to have our users run a very small app on their clients that basically runs the main...
5
by: Pilence | last post by:
Hy!! Can someone tell me please how to do this type of work done by using C#......
10
by: Walshi | last post by:
Hi all, I'm a relative newby to access and VBA etc. My forms and tables etc are working great and saving lots of time...However... I have two databases with the exact same table format. I want...
2
by: ChrisCicc | last post by:
Hi All, I got a real doozy here. I have read hundreds upon hundreds of forum posts and found numerous others who have replicated this problem, but have yet to find a solution. Through testing I have...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.