2

Im writing a program that manipulates files in C/C++, And I want to wrap it with a nice GUI made in C#. Is there a way to mix the C# gui with the C program? If there are multiple, what is the best way? (I tought about communicating with named pipes between both, but it seems a bit messy). Would it be possible to create the GUI with something like Unity, or should I use a library like XNA for it? (The GUI has to be "Fancy", something like Steam, or the Xbox dashboard, for instance).

Moshe Magnes
  • 393
  • 2
  • 9
  • 2
    Re. calling C++ from C# - have you checked out these two answers? http://stackoverflow.com/questions/935664/possible-to-call-c-code-from-c http://stackoverflow.com/questions/2211867/how-do-i-call-native-c-from-c – James Gaunt Nov 02 '12 at 09:56
  • When running on Windows or Windows like OS I would advice WPF / Silverlight as UI Framework. The community around has many C# Patterns you can implement. – menty Nov 02 '12 at 09:57
  • Consider writing two apps. One command line app in C/C++ with a well defined interface then call this command line app from your all singing and dancing GUI app. – alk Nov 02 '12 at 10:00

1 Answers1

1

take a look at interop, it will provide you with what you need to know I think. Although you will need a good API to make the interop work really effectivly.

'Interoperability enables you to preserve and take advantage of existing investments in unmanaged code. Code that runs under the control of the common language runtime (CLR) is called managed code, and code that runs outside the CLR is called unmanaged code. COM, COM+, C++ components, ActiveX components, and Microsoft Win32 API are examples of unmanaged code.'

http://msdn.microsoft.com/en-us/library/ms173184.aspx