Communicating between apps

  • Thread starter Thread starter John
  • Start date Start date
J

John

Hi

I need to send a string from one dotnet app to another from time to time. As
it is a light weight use I am wondering if there is a light weight way such
as using windows messaging to send this string without having to resort to
remoting etc. I would appreciate any ideas on how to carry this out. A code
example would be great.

Many Thanks

Regards
 
Hi

I need to send a string from one dotnet app to another from time to time.As
it is a light weight use I am wondering if there is a light weight way such
as using windows messaging to send this string without having to resort to
remoting etc. I would appreciate any ideas on how to carry this out. A code
example would be great.

I did this years ago in the UNIX world, but I haven't tried it yet
in .NET.

If the second app is a Console application that is created by the
first app, you can communicate with a couple of streams attached to
the Console app's Standard Input and Standard Output. If you have two
windows apps that were launched independantly, you should be ablt to
communitcate via a couple of named pipes.
 
Hi

I need to send a string from one dotnet app to another from time to time. As
it is a light weight use I am wondering if there is a light weight way such
as using windows messaging to send this string without having to resort to
remoting etc. I would appreciate any ideas on how to carry this out. A code
example would be great.

Many Thanks

Regards

If the apps are on the same machine, then you can do this using SendMessage
with WM_COPYDATA. Of course you have to be able to get the hwnd of the other
app, etc.
 
Hello Tom,
If the apps are on the same machine, then you can do this using
SendMessage with WM_COPYDATA. Of course you have to be able to get
the hwnd of the other app, etc.

This will be barred if you're runnign Vista if I understood correctly. The
safest way to do this is using named pipes. And an easy way to have real
object based communication is to use WCF to communicate between these applications
(can be configured to either use named pipes or tcp).
 
Hello Tom,


This will be barred if you're runnign Vista if I understood correctly. The
safest way to do this is using named pipes. And an easy way to have real
object based communication is to use WCF to communicate between these applications
(can be configured to either use named pipes or tcp).

Nothing wrong with named pipes :) Especially as they are supported no in the
runtime. But, he asked about the possibility of using windows messaging, so I
thought of WM_COPYDATA...

There are some limitations with WM_COPYDATA under vista, but I thought it had
to do with drivers and services - rather then desktop applications. I could
be wrong, I haven't used this technique for a while - long enough that I
haven't tried it on Vista :)
 
Back
Top