#include "stdafx.h" #include<windows.h> #include<stdio.h> int main(int argc,char* argv) { HANDLE h; BOOL con; DWORD byt; char buffer[1024]; h=CreateNamedPipe("\\\\172.16.11.30\\pipe\\p",PIPE_ACCESS_DUPLEX |FILE_FLAG_OVERLAPPED|FILE_FLAG_WRITE_THROUGH,PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE | PIPE_WAIT,PIPE_UNLIMITED_INSTANCES,512,512,NMPWAIT_USE_DEFAULT_WAIT,NULL); if (h == INVALID_HANDLE_VALUE) { printf(TEXT("CreateNamedPipe failed, GLE=%d.\n"), GetLastError()); return -1; } else printf("created sucessfullly\n"); con=ConnectNamedPipe(h,NULL); ReadFile(h,buffer,sizeof(buffer),&byt,NULL); printf("The data is %s\n",buffer); CloseHandle(h); return 0; }
CallNamedPipe()
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)