Thread: Pipe handling

  1. #1
    Registered User
    Join Date
    Apr 2008
    Posts
    14

    Pipe handling

    Hi,

    I am running an application through a pipe. This applcation starts to record sound from the soundcard until I hit Enter.

    To start the application I am using the following line:
    Code:
    _cmd_pipe = _popen(recordWaveCmd.c_str(),"r")
    then I use
    Code:
    fputc('\n',_cmd_pipe);
    to send a "\n" to stop recording.

    However, when I use the command
    Code:
    _pclose(_cmd_pipe);
    my main application stops until i hit the Escape key, and that's a problem.

    Is there anyway to solve this problem?

    Best regards,

    Alex.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Why are you trying to write to something that's opened read-only?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Apr 2008
    Posts
    14
    Accualy that is not the problem, already tried with "w". The application pauses when the _pclose function is called. I have to hit a key to continue the execution of the main application.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 4
    Last Post: 10-14-2009, 04:44 PM
  2. cont of IPC using PIPE
    By BMathis in forum C Programming
    Replies: 1
    Last Post: 03-15-2009, 05:16 PM
  3. Pipe class.
    By eXeCuTeR in forum Linux Programming
    Replies: 8
    Last Post: 08-21-2008, 03:44 AM
  4. event handling is serialized in MS Visual Studio C++ 2005 ??
    By mynickmynick in forum Windows Programming
    Replies: 3
    Last Post: 08-07-2008, 04:47 AM
  5. Pipe(): Interprocess or Intraprocess comm?
    By @nthony in forum C Programming
    Replies: 2
    Last Post: 03-28-2007, 07:27 PM