PC Review


Reply
Thread Tools Rate Thread

Communicating between apps

 
 
John
Guest
Posts: n/a
 
      2nd Apr 2009
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


 
Reply With Quote
 
 
 
 
joecool1969@live.com
Guest
Posts: n/a
 
      2nd Apr 2009
On Apr 2, 10:48*am, "John" <i...@nospam.infovis.co.uk> wrote:
> 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.
 
Reply With Quote
 
Tom Shelton
Guest
Posts: n/a
 
      2nd Apr 2009
On 2009-04-02, John <(E-Mail Removed)> wrote:
> 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.

--
Tom Shelton
 
Reply With Quote
 
Jesse Houwing
Guest
Posts: n/a
 
      2nd Apr 2009
Hello Tom,

> On 2009-04-02, John <(E-Mail Removed)> wrote:
>
>> 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.


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).
--
Jesse Houwing
jesse.houwing at sogeti.nl


 
Reply With Quote
 
Tom Shelton
Guest
Posts: n/a
 
      2nd Apr 2009
On 2009-04-02, Jesse Houwing <(E-Mail Removed)> wrote:
> Hello Tom,
>
>> On 2009-04-02, John <(E-Mail Removed)> wrote:
>>
>>> 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.

>
> 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).
> --
> Jesse Houwing
> jesse.houwing at sogeti.nl
>
>


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

--
Tom Shelton
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Communicating between apps John Microsoft Access 2 3rd Apr 2009 04:45 AM
Communicating between apps John Microsoft VB .NET 4 2nd Apr 2009 09:31 PM
Re: Two apps communicating with eachother Benny Mathew Microsoft C# .NET 0 1st Sep 2003 01:19 PM
All Windows apps not communicating with Network! CKazmier Windows XP Networking 1 18th Jul 2003 07:43 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:48 PM.