2

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...)

3 Answers 3

2

GTK is probably the easiest way (but, not easy at all). Qt will be much better if you can move to C++.

Sign up to request clarification or add additional context in comments.

Comments

2

You're either going to have to learn a new language or a new framework you're not familiar with. If you want to use straight C on Windows, you can use the Win32 API to create a window. However, Win32 is old, crusty, and not as easy to use are other frameworks. If you're going to be a Windows developer, you'd be better served picking up C#.

Comments

-1

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.

4 Comments

It was because C language does not define any windowing or GUI constructs, more over he said using VS2010.
Its not that I dont know the drawbacks about having GTK which is debatable on the visual sometimes. And having powerful VS do its work n u take the backseat, I dont know which one u prefer :P
Doesn't matter - he said C, and C# isn't C - there are libraries for C that do that. In fact, C# doesn't define any windowing or GUI constructs either; they're part of a library.
Getting your answer accepted doesn't mean anything. And, C# is sure as hell not C. So, before you insult me any further, I advise you to learn the difference between C and c#. And, by the way, writing "u" instead of "you" makes you look like an idiot.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.