I have a C console app, using VS2010, to which I would like to add a simple Window interface. (All the program does is a simple loop: get some input from the user, run the program, produce a single number as a result, continue). The input from the user basically involves just modifying the values of a C structure:
struct input {
int howMany;
char name[100];
int style;
char child[100];
char parent[100];
bool useShoes;
double weight;
}
Ideally, I’d like to pass a structure in, let the user make any changes, and get it back. What is the easiest way to go about this for someone who doesn’t want to spend a few days learning a new scripting or programming language ? (I only know C…what can I say, I was an English major…)
To create a window you need Form class in C#,
Create the Windows Forms project in VS2010. And you can embed your code there, but you have do write extra lines of code or convert code to C# to map the user input also the console output to the Windows forms which is pretty straight forward.
Here are the easy learning MSDN links to get started.
http://msdn.microsoft.com/en-us/library/ms229601.aspx
Hope it helps.