By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,459 Members | 1,472 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,459 IT Pros & Developers. It's quick & easy.

Passing command-line arguments to another instance

P: n/a
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

Jul 8 '08 #1
Share this Question
Share on Google+
5 Replies


P: n/a
If you had remoting code that was "nearly there", try changing it to use
IPC:

http://weblogs.asp.net/israelio/arch...04/346180.aspx

Marc
Jul 8 '08 #2

P: n/a
I saw something similar and tried ICP but used the tcp:// prefix, I will try
this, thanks!
Jul 8 '08 #3

P: n/a
Peter Morris wrote:
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).
>

Thanks
Pete

Jul 8 '08 #4

P: n/a
It seems that I was originally just using the IpcChannel incorrectly, the
URL helped me to realise this, thanks!

http://mrpmorris.blogspot.com/2008/0...plication.html
Pete

Jul 8 '08 #5

P: n/a
Not sure if you still care, but I just saw this:

http://www.hanselman.com/blog/TheWee...lBasicdll.aspx

It may not be exactly what you want, though. It is almost certainly
way easier than using a Mutex and such, though.

Kyle

On Jul 8, 8:01*am, "Peter Morris" <mrpmorri...@SPAMgmail.comwrote:
I have made my appsingle-instanceusing 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 existinginstance? *Any help appreciated, it's quite a vital part ofmy
app's functionality :-)

Thanks

Pete
Aug 5 '08 #6

This discussion thread is closed

Replies have been disabled for this discussion.