How to communicaton between two applications

G

George Chen

Hi

I have lots applications are already written by C++. It 's easy to use
PostMessage in one application and catch this message in another
application's WndProc Function.
Since .net have some powerful library. I use C# to develop new
application. But I do not know how to using simlar function in C# to
communication to my exist C++ application.
Any help would be appreciate.

George chen
 
E

Eugene Mayevski

Hello!
You wrote on Tue, 17 May 2005 11:42:24 -0700:

GC> Since .net have some powerful library. I use C# to develop new
GC> application. But I do not know how to using simlar function in C# to
GC> communication to my exist C++ application.

You can try MsgConnect ( http://www.eldos.com/msgconnect/ ) for this.
MsgConnect lets you communicate between applications residing on the same or
different systems easily using TCP, UDP, HTTP, memory-mapped files.

With best regards,
Eugene Mayevski
 
G

George Chen

Thanks Eugene,

Since my application runs on PocketPC, I am afraid MsgConnecct can not
run on PocketPC.
I just want to find a simple method to notify each other. Here is my code
in C++:
App a:
#define WM_SCANBARCODE WM_APP + 100
::postMessage(HWND_BROADCAST, WM_SCANBARCODE , 0, 0);
App b:
case WM_SCANBARCODE: // WM_SCANBARCODE = WM_APP + 100
break;

Thanks anyway,
George Chen
 
M

Mattias Sjögren

Since .net have some powerful library. I use C# to develop new
application. But I do not know how to using simlar function in C# to
communication to my exist C++ application.

PostMessage can still be used.



Mattias
 
G

George Chen

Thanks Mattias

For the sender, PostMessage can still be used in C#.
But, for the receiver, How does it get this notification message in C#?

Thanks
George Chen
 
G

George Chen

Hi, my friend
In order to using MSMQ, I have to rewrite my c++ appliction. but the
application is deployed to many customer already.
Thanks anyway
George
 
G

George Chen

Hi Mattias
I found I can override Class Form's WndProc Function from a Windows
Application.
But, Form's WndProc Function is not found from a Smart Device Application.
Only 5 protected function OnActivated, OnClosed, OnClosing, OnDeactivate and
OnLoad can be overrided. You know, compact framework has lack of
functionality.
Thanks again.

George Chen
 
M

Mattias Sjögren

Only 5 protected function OnActivated, OnClosed, OnClosing, OnDeactivate and
OnLoad can be overrided. You know, compact framework has lack of
functionality.

If you're targeting CF you can probably get better help in the group
microsoft.public.dotnet.framework.compactframework



Mattias
 
G

George Chen

Hi, Mattias
I will post my question to that group.
Thank your very much.
George Chen
 
E

Eugene Mayevski

Hello!
You wrote on Tue, 17 May 2005 12:37:57 -0700:

GC> Since my application runs on PocketPC, I am afraid MsgConnecct can
GC> not run on PocketPC.

It can. PocketPC is one of many supported platforms.

With best regards,
Eugene Mayevski
 
E

ep

Use the MessageWindow class in the CF. It's there exclusively for this
purpose.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetcomp/html/AsynchCallbacks.asp




George Chen said:
Hi Mattias
I found I can override Class Form's WndProc Function from a Windows
Application.
But, Form's WndProc Function is not found from a Smart Device Application.
Only 5 protected function OnActivated, OnClosed, OnClosing, OnDeactivate and
OnLoad can be overrided. You know, compact framework has lack of
functionality.
Thanks again.

George Chen
 
G

Guest

How about using C# P/Invoke to call the BroadcastSystemMessage API function?
I use the BroadcastSystemMessage/BroadcastSystemMessageEx all the time to
send messages between C++ applications. Should work with C# too.
 
L

LeapFrog

You can also use Named Pipes. Named Pipes are quite useful because they can
not only be used by two apps on the same machine, but they can also be used
by two apps on different machines (without stating the obvious that each
machine can "see" the other on a network.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top