IPC from Win32 C++ to C#

  • Thread starter Thread starter rob
  • Start date Start date
R

rob

Is there a relatively easy way to send text from a Win32 process to a
..NET process, preferably in VC++ for the Win32 side and C# for .NET.
 
Hello, rob!

r> Is there a relatively easy way to send text from a Win32 process to a
r> .NET process, preferably in VC++ for the Win32 side and C# for .NET.

It depends on that processes, if they both are GUI apps, or at least have message queue, you can use WM_COPYDATA windows message to transfer data between processes.

IMO most generic way will be usage of sockets ( TCP ).
--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
 
Just to add to Vadim,

see there
http://groups.google.com/group/micr...M_COPYDATA&qt_g=1&searchnow=Search+this+group for the samples of using C# and WM_COPYDATA

BTW, besides sockets there is some other way of IPC. Depending on you
requirements you can choose between sockets, remoting, WebServices,
EnterpriseServives, MessageQueue

Is there a relatively easy way to send text from a Win32 process to a
..NET process, preferably in VC++ for the Win32 side and C# for .NET.

--
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
 
Hi,

Michael Nemtsev said:
Just to add to Vadim,

see there
http://groups.google.com/group/micr...M_COPYDATA&qt_g=1&searchnow=Search+this+group
for the samples of using C# and WM_COPYDATA

BTW, besides sockets there is some other way of IPC. Depending on you
requirements you can choose between sockets, remoting, WebServices,
EnterpriseServives, MessageQueue

Not sure if you can use remoting with an unmanaged app, with webservice you
would need either another app (the service) or extend your .net app to
include it.

Another possible solution are named pipes, there is no support in .net (at
least in 1.1) but there are implementations floating around in the net.
 
Good lead, thanks!
Not sure if you can use remoting with an unmanaged app, with webservice you
would need either another app (the service) or extend your .net app to
include it.

Another possible solution are named pipes, there is no support in .net (at
least in 1.1) but there are implementations floating around in the net.

That's the hitch I was running into. Different technologies available
on the two platforms, but limited overlap. Sockets seemed to be
overkill and probably more effort than necessary. I even considered
clipboard, simple but aesthetically ungood. WM_COPYDATA seems a
decent compromise, even if it requires knowledge of the other
program's Window Name/Class. It affords some isolation (which the
clipboard does not).

I kept thinking I must have missed somthing, but I guess that's about
it.
 

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

Back
Top