Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [Solved] QProcess pipe creation on Windows
Forum Updated to NodeBB v4.3 + New Features

[Solved] QProcess pipe creation on Windows

Scheduled Pinned Locked Moved General and Desktop
9 Posts 2 Posters 4.3k 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.
  • K Offline
    K Offline
    keesvp
    wrote on last edited by
    #1

    In porting from Qt4 to Qt5 I had problems with the named pipes. I found I had to make the following adjustments:
    original:
    @ hRead = CreateNamedPipe(pipeName,
    PIPE_ACCESS_INBOUND | FILE_FLAG_OVERLAPPED,
    dwPipeFlags,
    1, // only one pipe instance
    0, // output buffer size
    dwPipeBufferSize, // input buffer size
    0,
    &secAtt);
    hWrite = CreateFile(pipeName,
    GENERIC_WRITE,
    0,
    &secAtt,
    OPEN_EXISTING,
    FILE_FLAG_OVERLAPPED,
    NULL);
    @
    My version:

    @ hRead = CreateNamedPipe(pipeName,
    ( isInputPipe ? PIPE_ACCESS_OUTBOUND : PIPE_ACCESS_INBOUND ) | FILE_FLAG_OVERLAPPED,
    dwPipeFlags,
    1, // only one pipe instance
    dwPipeBufferSize, // output buffer size
    dwPipeBufferSize, // input buffer size
    0,
    &secAtt);
    hWrite = CreateFile(pipeName,
    isInputPipe ? GENERIC_READ | FILE_WRITE_ATTRIBUTES :
    GENERIC_WRITE,
    0,
    &secAtt,
    OPEN_EXISTING,
    FILE_FLAG_OVERLAPPED,
    NULL);
    @

    Isn't it essential to have the in/out dependent mode settings???

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      It seems indeed to be strange. You should check the "bug report system":http://bugreports.qt-project.org to see whether it's something known. If not, you could open a new bug report explaining what was working and what doesn't. Providing a minimal compilable example that shows the behavior would be really great.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • K Offline
        K Offline
        keesvp
        wrote on last edited by
        #3

        Thanks.
        I just filed a bug report.I couldn't find a report mentioning the same issue.
        It's not simple to extract a minimal example, but I'll try.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Can you share the link to the report ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • K Offline
            K Offline
            keesvp
            wrote on last edited by
            #5

            Sure:
            https://bugreports.qt-project.org/browse/QTBUG-35357

            I realize it's terse. I'm working on an extracted sample. Problem is, this is a huge project. I'm having another issue that might be or not be related. And is in cooperation with libuv, which is complex in its own way.

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Do you know how to trigger the bad behavior ?

              Just a supposition but I think you need two processes: one that you call with QProcess and your software where you use QProcess then you can establish the communication between the two. So it looks like a subdir project with two applications. Hope it helps

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • K Offline
                K Offline
                keesvp
                wrote on last edited by
                #7

                Yes, that's exactly what I'm working on. I've been able to set it up like that with 2 VS-2012 projects, which I can run/debug in parallel. I need to 'skin' libuv to get something communicable.

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  Great ! If I may, once you're done, convert them in one or two qmake powered project so it's not tied to VS

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    Just saw that the bug has been solved, please update the thread title prepending [solved] so other forum users may know that a solutions has been found :)

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    0

                    • Login

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups
                    • Search
                    • Get Qt Extensions
                    • Unsolved