PDA

View Full Version : how to call another application in a application?




chidambaram
Apr 11, 2008, 09:01 AM
hi all,

I am working in a carbon c++ application using XCode in MAC machine.

I have two carbon c++ applications(for example,name of applications are get and set)

In first application(get.xcodeproject),
on button click event how can i call second application(set.xcodeproject)


Thanks in advance and very urgent plz....



lee1210
Apr 11, 2008, 09:06 AM
Fork and exec are the traditional way of doing this sort of thing.

You can call system() to run another program as well, but you will have to wait for the second command to finish.

Dependent on what you need vfork might be best since you intend to run a completely different program and probably don't need to retain the process space of the parent program.

man on any of these for more info.

-Lee

yeroen
Apr 11, 2008, 10:45 AM
I highly recommend you pick up a copy of Stevens' Advanced Programming in the UNIX Environment (http://www.amazon.com/Programming-Environment-Addison-Wesley-Professional-Computing/dp/0201433079/ref=pd_bbs_sr_1?ie=UTF8&s=books&qid=1207928286&sr=8-1).

It's the standard reference for all the "system" programming tasks, like fork and exec. It also covers threads, sockets, IPC, pseudo-terminals, etc.