title: Create Named Pipe C++ Windows
body: <p>I am trying to create a simple comunication between 2 processes in C++ ( Windows ) like FIFO in linux.
  This is my server:</p>
  
  <pre><code>int main()
  {
      HANDLE pipe = CreateFile(TEXT("\\\\.\\pipe\\Pipe"), GENERIC_READ, 0, NULL, OPEN_EXISTING,    FILE_FLAG_OVERLAPPED, NULL);
      ConnectNamedPipe(pipe, NULL);
      while(TRUE){
          string data;
          DWORD numRead =1 ;
          ReadFile(pipe, &amp;data, 1024, &amp;numRead, NULL);
          cout &lt;&lt; data &lt;&lt; endl;
  
  }
      CloseHandle(pipe);
      return 0;
  }
  </code></pre>
  
  <p>And this is my client:</p>
  
  <pre><code>int main()
  {
      HANDLE pipe = CreateFile(TEXT("\\\\.\\pipe\\Pipe"), GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);
      ConnectNamedPipe(pipe, NULL);
      string message = "TEST";
      DWORD numWritten;
      WriteFile(pipe, message.c_str(), message.length(), &amp;numWritten, NULL);
      return 0;
  }
  </code></pre>
  
  <p>The code does't work , how can i fixed it to like FIFO ? </p>