Unable to create named pipe w/err 0x0000007b
I am getting the above error when I try to connect the server and client on different machines.
The code I got from MSDN Link: http://code.msdn.microsoft.com/windowsdesktop/CppNamedPipeCommunication-7447a0bf
I am using Windows 7 machines to communicate.
#define FULL_PIPE_NAME L"\\\\.\\pipe\\SamplePipe"
To communicate with different machines I changed the above line to:
#define FULL_PIPE_NAME L"\\\\My Machine's IP address\\pipe\\SamplePipe"
Note: In the same machine itself, it will work only if the path is : L"\\\\.\\pipe\\SamplePipe". It will give the same error if I provide the same machine's IP address.
Error code 0x0000007B is ERROR_INVALID_NAME
("The filename, directory name, or volume label syntax is incorrect"). Read the documentation. When the server calls CreateNamedPipe()
, it must use the "\\.\pipe\SamplePipe"
name only, as it cannot create a pipe on another machine. When a client connects to the pipe, it can use the "\\ServerName\pipe\SamplePipe"
name if connecting to a pipe on a remote or local machine, or the "\\.\pipe\SamplePipe"
name only if connecting to a pipe on the local machine. The client cannot use the server's IP Address, it has to use the server's network machine name instead.
User contributions licensed under CC BY-SA 3.0