• 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: call C application
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: call C application


  • Subject: Re: call C application
  • From: Mai Bui <email@hidden>
  • Date: Thu, 27 Apr 2006 15:26:13 -0700

Thanks all of you for replying quickly my mail.

Yes, I tried to use NSTask, it seems to work. (it can launch my C app, not stop though - I will work on it!).

But, I have another question: In my cocoa app I have a window to display out put. How can I make "printf()" in my C app into this display window?

Thanks again for providing idea and knowledge.

My regards,
Mai.
On Apr 27, 2006, at 1:51 PM, Ondra Cada wrote:

Mai,

On 27.4.2006, at 22:45, email@hidden wrote:

Way 2 (UNIX way):
If you don't want to hook input/output streams (STDIN/STDOUT) then you can simple call C-library function
system();

Rather not, in this case. The "system" function is easier to hook up than NSTask, but (unless you are very careful) chokes on simple spaces in file/folder names (and more).


Still, "system" is great for some tasks -- namely launching standard system (hence the name!) commands with fixed arguments -- but I do strongly recommend refraining from it for generic executables.
---
Ondra Čada
OCSoftware: email@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc



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


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: call C application
      • From: "Jordan Krushen" <email@hidden>
    • Re: call C application
      • From: j o a r <email@hidden>
References: 
 >call C application (From: Mai Bui <email@hidden>)
 >Re: call C application (From: "email@hidden" <email@hidden>)
 >Re: call C application (From: Ondra Cada <email@hidden>)

  • Prev by Date: Re: Selector of Open recent document
  • Next by Date: Re: call C application
  • Previous by thread: Re: call C application
  • Next by thread: Re: call C application
  • Index(es):
    • Date
    • Thread