hi,
I am doing a project in which i am using VC++ and C# both. VC++ is for hardware interface (no other go, i must use VC++ only) and the application side i am using C# (micro soft visual studio 2008).
For both the programs to communicate to each other i am using named pipes (this is also must).
I am able to communicate between C# and VC++, but NOT VC++ to C#.
I have given the code below which i am using in C#.
using (NamedPipeServerStream pipeStream = new NamedPipeServerStream("mytestpipe"))
{
pipeStream.WaitForConnection();
Console.WriteLine("[Server] Pipe connection established");
using (StreamReader sr = new StreamReader(pipeStream))
{
while ((temp = sr.ReadLine()) != null)
{
MessageBox.Show(temp));
}
}
}
The problem here is the sr.ReadLine()
. is not terminated at all. It should stop once it finds null, but the null value given by VC++ is not taken as NULL in C#.
Now how should i go about?