Communication between c++ and c# applications

G

George Chen

Hi

I have lots applications are already written by emberded c++. It 's easy
to use
PostMessage in one application and catch this message in another
application's WndProc Function.
Here is my c++ code:
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;

Since .net have some powerful library like web service. 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
 
P

Peter Foot [MVP]

There are a whole range of inter-process commnication options available.
Daniel sums them up well in this article (and part two linked at the end)
http://www.danielmoth.com/Blog/2004/09/ipc-with-cf-on-ce-part-1.html

In your specific example you can use windows messages back and forth between
your managed app and a native app - see the
Microsoft.WindowsCE.Forms.MessageWindow class which you can derive from and
override the WndProc to capture incoming messages, there are also
SendMessage and PostMessage methods.

Peter
 

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