• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Best way to launch command-line program from C++ application
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Best way to launch command-line program from C++ application


  • Subject: Re: Best way to launch command-line program from C++ application
  • From: David Gagnon <email@hidden>
  • Date: Fri, 20 Mar 2009 16:48:50 -0400
  • Thread-topic: Best way to launch command-line program from C++ application

Hi,

Our program is a C++ plug-in for Acrobat. So, we need to launch a
command-line program to send HTTP message (sending HTTP message within a
plug-in cause many problems). Our small command line program take 1
parameter (path) and return an error value. So, I tried "exec" but it does
not work, because Acrobat is multi-process. See this link:

http://factor-language.blogspot.com/2007/07/execve-returning-enotsup-on-mac-
os-x.html

Also, posix_spawn could be a nice choice but it is available in 10.5 only.
So I think that "system" or "popen" are the most credible candidate now.

Have a better/simpler idea?

Thanks!

David


On 09-03-19 16:57, "Dave Carrigan" <email@hidden> wrote:

>
> On Mar 19, 2009, at 1:48 PM, David Gagnon wrote:
>
>> What is the best/easiest way to launch a command-line program from
>> our C++ application? I know how to do it using ³System.framework²
>> but it is a bit complicated. I need a function like ³ShellExecute²
>> on PC... ;-)
>
> If it's objective-c++ you could use NSTask.
>
> There is also Launch Services, which I think comes closest to
> ShellExecute, depending on how you're using ShellExecute.
>
> For straight C++ with a true command line program you can likely use
> fork/exec.
>
> Give us a better idea of what exactly you need to do, and we can tell
> you which of those options is better.



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Best way to launch command-line program from C++ application
      • From: Rush Manbert <email@hidden>
    • Re: Best way to launch command-line program from C++ application
      • From: Dave Carrigan <email@hidden>
    • Re: Best way to launch command-line program from C++ application
      • From: Jean-Daniel Dupas <email@hidden>
References: 
 >Re: Best way to launch command-line program from C++ application (From: Dave Carrigan <email@hidden>)

  • Prev by Date: Re: Preprocessing within @"SOMEDEFINEDSTRING"
  • Next by Date: Re: Best way to launch command-line program from C++ application
  • Previous by thread: Re: Best way to launch command-line program from C++ application
  • Next by thread: Re: Best way to launch command-line program from C++ application
  • Index(es):
    • Date
    • Thread