how to call another application in a application?

Discussion in 'Mac Programming' started by chidambaram, Apr 11, 2008.

  1. chidambaram macrumors member

    Mar 9, 2008
    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....
  2. lee1210 macrumors 68040


    Jan 10, 2005
    Dallas, TX
    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.

  3. yeroen macrumors 6502a


    Mar 8, 2007
    Cambridge, MA
    I highly recommend you pick up a copy of Stevens' Advanced Programming in the UNIX Environment.

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

Share This Page