"Maxim Yegorushkin" <> wrote in message
news:aa5e2446-7e2a-498d-8f49-...
On Jun 9, 6:38 am, Magdy <magdy....@gmail.com> wrote:
> I have two applications, one c# and another c++. I want the c# one to
> run the c++ application and sends message (ex. string ... certain data
> needed to initialize the c++ application) to it.
>
> Please, help me... how to implement that in both sides (C# sends
> message & C++ receives it)
>
> Any thoughts, ideas, advice will be highly appreciated.
<
You can redirect standard input and output of your C++ program, so
that it receives commands on its standard input from a C# application,
and writes responses into its standard output, which the C#
application reads.
Or, if the C++ application is a standalone server, you can use TCP
sockets for sending commands and receiving responses.
>
or, if running within the same process, one can make use of C code (true, or
'extern "C" { ...}') and P/Invoke...
C# -> C, C -> C++
getting things the other way (C++ -> C#) is a little harder AFAIK (not much
real experience with .NET in my case...), although particular .NET VMs are
likely to provide APIs for this case.