Passing command-line arguments to another instance

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
 
P

Peter Morris

I saw something similar and tried ICP but used the tcp:// prefix, I will try
this, thanks!
 
B

Ben Voigt [C++ MVP]

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).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top