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

make two applications that communicate

P: 4
hi
i want to be able to have two applications in c# visual studio.net 2008 to be able to communicate with each other by passing parameters.
for example; Appli1.exe is a form with 4 buttons
Appli2.exe should be executed when a particular button is pressed in Appli1.exe, but it should know which button has been pressed,

therefore i want to make a call to second application, such as:

Appli2.exe(button number) if i were to put it crudely!

i have done something like this in c++ within QNX enviroment, but havent a clue of how to do it in c#...
Jan 13 '09 #1
Share this Question
Share on Google+
4 Replies


vekipeki
Expert 100+
P: 229
One way would be the EventWaitHandle Class (System.Threading). EventWaitHandle class provides access to named system synchronization events, which means that by providing a name for your event, you can get a handle to the same system event in multiple processes:

Expand|Select|Wrap|Line Numbers
  1. EventWaitHandle ewh = new EventWaitHandle(false, EventResetMode.AutoReset, "SomeUniqueName");
Jan 13 '09 #2

P: 4
so the "someuniquename" can be a .exe application?
how do i pass parameters between the two applications?
Jan 13 '09 #3

vekipeki
Expert 100+
P: 229
For simple inter-process synchronization, you can use named EventWaitHandle, Mutex and Semaphore classes. You cannot use them to send information, but you can have several events with different names. Name of the event can be anything you like, but you should consider making it unique to avoid collisions with other programs (e.g. "YourApp.SomeEvent", "YourApp.SomeOtherEvent" etc.)

If you want to exchange data between applications, Remoting is the way to go. Google it for some examples (check this thread also: http://bytes.com/groups/net-c/253478...-communication).
Jan 13 '09 #4

P: 4
thanks vekipeki, i will give it a try and see how it works..
Jan 13 '09 #5

Post your reply

Sign in to post your reply or Sign up for a free account.