Passing command-line arguments to another instance

  • Thread starter Thread starter Peter Morris
  • Start date Start date
P

Peter Morris

I have made my app single-instance using a Mutex but now need to pass on the
command line parameters too. I tried using remoting but wasn't happy with
this approach as the windows firewall asks if I want to permit it to open
the socket.

I was thinking maybe there was a simple WinApi way of sending a string to
the existing instance? Any help appreciated, it's quite a vital part of my
app's functionality :-)


Thanks


Pete
 
I saw something similar and tried ICP but used the tcp:// prefix, I will try
this, thanks!
 
Peter said:
I have made my app single-instance using a Mutex but now need to pass
on the command line parameters too. I tried using remoting but
wasn't happy with this approach as the windows firewall asks if I
want to permit it to open the socket.

I was thinking maybe there was a simple WinApi way of sending a
string to the existing instance? Any help appreciated, it's quite a
vital part of my app's functionality :-)

You could use a mailslot or pipe instead of a mutex, then you can pass data
through it (i.e. TransactNamedPipe).
 
Back
Top