Two way Communication between exe and dll  
Author Message
Balu Vasudev





PostPosted: Visual C# General, Two way Communication between exe and dll Top

How could i acheive two way communication between the exe and my dll (without adding reference of each other in both )

thanks



Visual C#19  
 
 
mecspek





PostPosted: Visual C# General, Two way Communication between exe and dll Top

use system.diagnostics namespace Process class to execute your exe from the dll.,

To instantiate your dll(assembly) from the exe, if you do not want to refer this dll in your app, you can dynamically invoke this assembly by using the Assembly class LoadFrom method. Then you can use reflection to invoke the methods

mecspek


 
 
Balu Vasudev





PostPosted: Visual C# General, Two way Communication between exe and dll Top

hi,

thanx for ur quick response but i think i didn't make it clear enough.

My problem is that I have a class residing in the dll which needs some data from the exe..(ie A function in the dll needs access to some classes defined in the exe) and also at the same time exe should have access to all public classes defind in the dll also.


 
 
mecspek





PostPosted: Visual C# General, Two way Communication between exe and dll Top

From your dll function call the exe with parameters

Example, if your exe name is testExe, call it as Process.Start("testExe", ---parameters---)

These parametes you can configure it in such a way that it calls a specific class method for a particular parameter.

Do look into MSDN System.Diagostics namespace and it should be clear.

mecspek


 
 
RizwanSharp





PostPosted: Visual C# General, Two way Communication between exe and dll Top

See System.Reflection namespace.

Best Regards,

Rizwan



 
 
Andrej Tozon





PostPosted: Visual C# General, Two way Communication between exe and dll Top

Just a question... why don't you want to reference a dll from your exe

Andrej