2

I have been given a task to develop a Windows application that acts as a wrapper for an existing C application. The C application is controlled by the command line. I want know if it is possible to use WPF as the GUI for this application?

  • 3
    Sure it is possible. What problems have you encountered so far? – jltrem May 16 '13 at 13:19
  • Do you have the source of this application, or do you have to launch its exe from your .NET code ? In the former, the keyword you're looking for is 'interop' – Jem May 16 '13 at 13:21
  • Thanks for your answers, this is still in the planning stage. I do have the source code for the application. – Vercingetorix May 16 '13 at 14:21
  • http://stackoverflow.com/questions/4719359/c-sharp-c-interoperability – N_A May 23 '13 at 17:41
  • http://stackoverflow.com/questions/3726829/writing-a-dll-in-c-c-for-net-interoperability – N_A May 23 '13 at 17:42
  • There are SOOOOOO many dups for this question. – N_A May 23 '13 at 17:42

1 Answers1

0

When your app is a console application try this:

Process process=Process.Start(new ProcessStartInfo("Your.exe") {
    RedirectStandardInput = true,
    RedirectStandardOutput = true,    
    RedirectStandardError = true,
    UseShellExecute = false,
});
process.StandardInput.WriteLine("Your command");
var yourAnswer=process.StandardOutput.ReadLine();

this is only an simple example and maybe there are other solutions to communicate with your app. good search keyword is "IPC" :-)

Kux
  • 1,362
  • 1
  • 16
  • 31