1.

Solve : Visual C++ 2008 - GUI user input and write appending to text file?

Answer»

So I am making the transition from VC6 to VC++ 2008 Express and went looking for an example to look at on how to take a user input in Windows GUI that is a char string and write that appending to a text FILE and no such luck, but tons of info on how to do this in Console dos shell mode for user input and write to file which I already know how to do.

Anyone know of a good site for examples - or - can share a coded example on how to do this in VC++ 2008 Express?

Even with VC6, I never created a Windows GUI program before, but mainly Console shell executed programs. Kind of wish the college professor back then went into the Visual C++ instead of Console C++ which is a down and dirty and primitive like user interface. I have a project that is currently coded as a Console app that I want to clean up into my first ever programmed Windows GUI program. And I got copy of VC++ 2008 Express, so that I can use modern .NET

A while back when looking into Windows GUI programming many people told me to switch to Visual Basic which is easier than Visual C++, but I was stubborn and stuck with C++. Should I make the transition from C++ to VB? Probably couldnt hurt to know both anyways?creating a User interface in C++ is the same REGARDLESS of the compiler or IDE you use; you use the win32 API C functions.

Scratch Application.

You can also use .NET and windows forms using the CLI extensions to C++ provided by the MS C++ Compiler and Visual Studio. The "generic" program for that can be created within the IDE using the new project dialog:



In project types, choose Other Languages->Visual C++->CLR, and then "Windows Forms Application" in the Templates List.

Adding to this, a "generic" Win32 Application can be generated in the same fashion, by choosing Win32 rather than CLR, and selecting "Win32 Project" from the panel.

Quote

Kind of wish the college professor back then went into the Visual C++ instead of Console C++
There is no "Visual C++" or "Console C++" language; Visual C++ is the name of the C++ IDE MICROSOFT produced some years ago for working with the Win32 API. The "Visual" portion has been largely untrue, really. Creating a GUI in C++ using the Win32 API takes, quite literally, several pages of C code; this isn't something any class can really teach, especially since Programming classes/courses are there to teach the programming concepts using the language, not how to use a specific library (like the win32 API). Console input/output usually only amounts to learning a few basic functions, rather than  having to learn an entire library if windows messages and callback function names and headers, so focus can be kept on syntax and semantics.

Quote
A while back when looking into Windows GUI programming many people told me to switch to Visual Basic which is easier than Visual C++, but I was stubborn and stuck with C++. Should I make the transition from C++ to VB? Probably couldnt hurt to know both anyways?
If you want to work with .NET, I would personally recommend C#.. but, that could be rather BIASSED, since that is now my language of choice , but also since you will be more familiar with much of the syntax and semantics(with the exception that you cannot use multiple inheritance). Visual Basic .NET however would work just as well.

C++/CLI works, but it has a lot of disadvantages; mostly in that the IDE's intellisense support for C++ blows. And you can't force it to show like you could in VC6 pressing Control-Alt-T, from what I can tell. Also, the windows forms Designers sometimes act a bit weird when used with a C++ project. I'd recommend giving them each a fair go though at some point. (C#,C++/CLI,VB.NET). Maybe even try a Win32 project; just make sure you've got a fair handle on callback functions and function pointers and whatnot.
Thanks BC!

Will post back if i have any problems.


Discussion

No Comment Found