Click here to Skip to main content
15,868,016 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
1.If A is a one windows form EXE
2.B is a another Windows Form EXE.
3. Have to Establish the connection between this exes how is it possible

EXAMPLE:

1.IF i click the one button in exe A ,the click event have to be occur in exe B.and the result going to be reflect to exe A.
2.If i Click the exe B the click event will be occur into exe A and result going to be reflect in EXE B.

So How to establish this two exe communication using the C#.net windows Application .IF any one Know the Answer. plz help me.its very useful for me.
Posted

Messages. Two processes communicated each other using Messages. You need to use remoting or something like that.

Following are some of the possible options.
1) communicate using WCF based inter process communication
2) communicate via simple file based approach(one exe writes and other monitors and read)
3) communicate via sockets
4) communicate via Windows Message Queues
 
Share this answer
 
v2
Comments
Sergey Alexandrovich Kryukov 28-Jun-11 13:53pm    
Not completely agree with you. We need to know the required functionality to answer exactly, but chances are, message communication would be bad approach.
Why? -- please see my answer.
--SA
Sweetdin 30-Jun-11 3:48am    
Thank u very much
Short answer: try to avoid it my all means if you have source code for both or both are .NET assemblies. You have a chance to use one of them as a library and reference in your project as any library assembly. This is quite possible.

Let's be logical. You need to establish messaging/remoting communications between two application. Assume they are already working applications. You cannot add communication facility unless you modify their code. So, you should have access to the code. If so, you better integrate them together. Always better to use separate threads, not separate processes.

—SA
 
Share this answer
 
Comments
Vivek Krishnamurthy 28-Jun-11 14:10pm    
Agree ! My 5
Sergey Alexandrovich Kryukov 28-Jun-11 14:11pm    
Thank you, Vivek.
--SA
Wild-Programmer 28-Jun-11 23:05pm    
Perfect :) that's more accurate. 5+
Sergey Alexandrovich Kryukov 28-Jun-11 23:25pm    
Thank you very much, Amit.
--SA
Sweetdin 30-Jun-11 3:48am    
Thank U very much
I would agree with Solution 2, however you can use UI Automation to achieve this.

UI Automation Overview[^]

I will be applicable in the case you already have a windows application(From question Exe B), and building a new application which will perform the click (From question Exe A).
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 28-Jun-11 23:26pm    
That is true and good to know, my 5. However, I would say this can be a last resort.
--SA
RakeshMeena 29-Jun-11 1:32am    
My 5 Vivek!
Vivek Krishnamurthy 29-Jun-11 2:13am    
Thanks!
Sweetdin 30-Jun-11 3:47am    
Thank u very much

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900