K
kalpesh
i have a serious problem with CreateNamedPipe:
I am developing a virtual printer driver in VISTA, for that at one
point i use NamedPipe ok..
Now if my all code is run good then there is no any problem becuse at
the end of printing job i disconnect this named pipe and close this
handle.
Now consider the case that my NamedPipe is created and without close
it my printer driver crash at some point means when ever second time
any print job is there it does not createNamePipe gives me error
ERROR_ALREADY_EXISTS that "Cannot create a file when that file
already
exists".
here i write my code for create named pipe
hBitmapPrinterPipe = CreateNamedPipe( L"\\\\.\\Pipe\
\BitmapPrinterPipe", // pipe name
PIPE_ACCESS_DUPLEX|
FILE_FLAG_OVERLAPPED,
PIPE_TYPE_BYTE
|
PIPE_WAIT,
PIPE_UNLIMITED_INSTANCES,
MAX_PATH,
MAX_PATH,
NMPWAIT_USE_DEFAULT_WAIT,
NULL)
if(hBitmapPrinterPipe == INVALID_HANDLE_VALUE) {
GetLastError())
}
Using this code i create my pipe..
so my question is there is any method from which i can reopen my
existing server pipe and close it..
OR there is any solution from which i can open the another instance
of
the same name pipe..
so please write me which solution is best for me and how can i do
it..
Thanks in advance..
I am developing a virtual printer driver in VISTA, for that at one
point i use NamedPipe ok..
Now if my all code is run good then there is no any problem becuse at
the end of printing job i disconnect this named pipe and close this
handle.
Now consider the case that my NamedPipe is created and without close
it my printer driver crash at some point means when ever second time
any print job is there it does not createNamePipe gives me error
ERROR_ALREADY_EXISTS that "Cannot create a file when that file
already
exists".
here i write my code for create named pipe
hBitmapPrinterPipe = CreateNamedPipe( L"\\\\.\\Pipe\
\BitmapPrinterPipe", // pipe name
PIPE_ACCESS_DUPLEX|
FILE_FLAG_OVERLAPPED,
PIPE_TYPE_BYTE
|
PIPE_WAIT,
PIPE_UNLIMITED_INSTANCES,
MAX_PATH,
MAX_PATH,
NMPWAIT_USE_DEFAULT_WAIT,
NULL)
if(hBitmapPrinterPipe == INVALID_HANDLE_VALUE) {
GetLastError())
}
Using this code i create my pipe..
so my question is there is any method from which i can reopen my
existing server pipe and close it..
OR there is any solution from which i can open the another instance
of
the same name pipe..
so please write me which solution is best for me and how can i do
it..
Thanks in advance..