F
fahad.usman
I am making an application in which if the second instance of the same
application is launched, it checks its command-line arguments and
passes them to the already running instance. I have been told by
someone that using named pipes is one of the most commonly used ways
of doing this. But I did it in a simpler way; I saved the command-line
arguments in a text file and passed a message to the previously
running instance to read the arguments from that file. The second
instance then terminates and the first instance deletes the file after
reading the arguments from it. This technique is working perfectly
fine for me, but I was just wondering that are there any drawbacks in
this approach or am I going to get any advantage if I do it using
named pipes?
(I read on support.microsoft (http://support.microsoft.com/kb/q95900)
that shared files is one of the ways for IPC but i am not sure what i
am doing is actually that 'shared files')
application is launched, it checks its command-line arguments and
passes them to the already running instance. I have been told by
someone that using named pipes is one of the most commonly used ways
of doing this. But I did it in a simpler way; I saved the command-line
arguments in a text file and passed a message to the previously
running instance to read the arguments from that file. The second
instance then terminates and the first instance deletes the file after
reading the arguments from it. This technique is working perfectly
fine for me, but I was just wondering that are there any drawbacks in
this approach or am I going to get any advantage if I do it using
named pipes?
(I read on support.microsoft (http://support.microsoft.com/kb/q95900)
that shared files is one of the ways for IPC but i am not sure what i
am doing is actually that 'shared files')