How to communicate to an executing C program from VB.NET

  • Thread starter Thread starter hlam
  • Start date Start date
H

hlam

I am developing a VB application using Visual Studio.NET
and I need to communicate with a C program (supplying it
with inputs and receiving output from it). What is the
best way to do this?

Thanks in advance,
H. Lam
 
I am developing a VB application using Visual Studio.NET
and I need to communicate with a C program (supplying it
with inputs and receiving output from it). What is the
best way to do this?

Thanks in advance,
H. Lam

What kind of app is the C app? Is it a console application or is it a
typical Windows GUI?

If it is a console application, you can use the
System.Diagnostics.Process class to start the process and redirect the
stdin and stdout to you program.

Anyway, you need to supply more information...
 
* "hlam said:
I am developing a VB application using Visual Studio.NET
and I need to communicate with a C program (supplying it
with inputs and receiving output from it). What is the
best way to do this?

Please provide more details about the C application. Do you have the
source code? Is it a console application or does it have windows?
 
It is a c app that we will be writing that can be executed
from a DOS prompt. We also want it to be an "engine" to
the VB app so the VB app can call it to pass it data and
get data in return.

Thanks in advance for your help.
H. Lam
 
It is a c app that we will be writing that can be executed
from a DOS prompt. We also want it to be an "engine" to
the VB app so the VB app can call it to pass it data and
get data in return.

Thanks in advance for your help.
H. Lam

Ahh, then it is a console application. Then you'll want to look at the
System.Diagnostics class. With that class you can start the application,
and redirect it's stdin and stdout to your own application... There is
a thread here were I already posted some example source of this. It is
discussing ReadConsoleOutput and ReadConsoleOutputChar. If you look for
those in the subject you'll find it :)

HTH
 
Back
Top