Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Inter-process communication problem

Inter-process communication problem

Scheduled Pinned Locked Moved C / C++ / MFC
helpcomtutorialquestion
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    RickyC
    wrote on last edited by
    #1

    Hello everybody! I have two process (father and child) and my implementation was all based in the article How to spawn console processes with redirected standard handles. Everything works fine, send command and receive answers from the child process (command line)... but, it works just a few times (two to be more exactly). In the third command that I send, there is no answer. The WriteFile function does not give any error, and the ReadFile ('Threaded') function don't receive any bytes and don't accuse any errors to. In this case, I'm even using the PeekNamedPipe function to know how much bytes (if it's there) I have to read. It's strange to me... everything is working fine, but suddenly stops working. :sigh: Does anybody here already have this problem or knows what I'm doing wrong? Thanks in advance! cheers!

    L 1 Reply Last reply
    0
    • R RickyC

      Hello everybody! I have two process (father and child) and my implementation was all based in the article How to spawn console processes with redirected standard handles. Everything works fine, send command and receive answers from the child process (command line)... but, it works just a few times (two to be more exactly). In the third command that I send, there is no answer. The WriteFile function does not give any error, and the ReadFile ('Threaded') function don't receive any bytes and don't accuse any errors to. In this case, I'm even using the PeekNamedPipe function to know how much bytes (if it's there) I have to read. It's strange to me... everything is working fine, but suddenly stops working. :sigh: Does anybody here already have this problem or knows what I'm doing wrong? Thanks in advance! cheers!

      L Offline
      L Offline
      led mike
      wrote on last edited by
      #2

      This is just a guess since no one else replied. Most of my IPC experience is socket based. If you don't solve this you might try that approach. Anyway the IO streams might have ( based on a vague memory ) error states that you need to reset (clear) before each read and/or write operation. Hope that helps.


      "What classes are you using ? You shouldn't call stuff if you have no idea what it does" Christian Graus in the C# forum led mike

      R 1 Reply Last reply
      0
      • L led mike

        This is just a guess since no one else replied. Most of my IPC experience is socket based. If you don't solve this you might try that approach. Anyway the IO streams might have ( based on a vague memory ) error states that you need to reset (clear) before each read and/or write operation. Hope that helps.


        "What classes are you using ? You shouldn't call stuff if you have no idea what it does" Christian Graus in the C# forum led mike

        R Offline
        R Offline
        RickyC
        wrote on last edited by
        #3

        Hi led mike! Thanks for your answer. I've been searching for those error states that need to reset, but I don't found them in MSDN and nowhere. I've been thinking about use named pipes (I'm using anonymous), but this really scares me... my project is already late, and the use of named pipes will demand a whole new approach. Thanks for your help led mike, best regards

        L 1 Reply Last reply
        0
        • R RickyC

          Hi led mike! Thanks for your answer. I've been searching for those error states that need to reset, but I don't found them in MSDN and nowhere. I've been thinking about use named pipes (I'm using anonymous), but this really scares me... my project is already late, and the use of named pipes will demand a whole new approach. Thanks for your help led mike, best regards

          L Offline
          L Offline
          led mike
          wrote on last edited by
          #4

          Rember this is just wild guessing http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt_clearerr.asp[^]


          "What classes are you using ? You shouldn't call stuff if you have no idea what it does" Christian Graus in the C# forum led mike

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups