GUI Programming - Visual Studio 2008 and C++

Started by
22 comments, last by AAA 15 years, 9 months ago
The closest thing you'll find in VS2008 for C++ is winforms.
I used it to make simple GUI for a lottery number maker program I did in my C++ class and it didn't take much work.
It has the same drag and drop GUI controls and stuff as if you were creating a winform app in VB or C#. The code used is Microsoft's bastardized C++ called managed C++ or CLI though. I stuck with standard C++ and the STL and it worked fine for me though. A lot easier than trying to learn MFC or straight up Win32 the only other common alternatives from Microsoft for C++!
Yeah it'd be way easier and faster to do in VB or C# but if you don't already know them languages and don't have time C++ Winforms is the way to go.
Here is video that should give you enough of the basics to get started:

Building Windows Forms Applications with Wizards in Visual C++ Express (12 Minutes - 8.2 MB)

This video will take you through the steps for creating a new Windows Form application using the wizards available in Visual C++ Express. The steps include naming the project, choosing the appropriate settings, adding controls, adding event handling code, and building and running the application that was created. After following these steps, you should have familiarity with how to add additional controls and event handling code to create a more robust Windows Form application.

You can check out the rest of the video's and some MFC ones if you decide to go that route which not even Microsoft uses so I'd avoid it unless you have no choice!


"So, what does MS use?
Almost all current Microsoft products are written in VC++. Very few use MFC. Some newer projects are being done in C# and C++/CLI.

I don't think it was ever a huge secret that MFC never caught on significantly within Microsoft."


Anyways, there are video's on using win32,mfc,winforms, and atl on that link I provided so you can decide for yourself.

[Edited by - daviangel on July 8, 2008 3:48:04 PM]
[size="2"]Don't talk about writing games, don't write design docs, don't spend your time on web boards. Sit in your house write 20 games when you complete them you will either want to do it the rest of your life or not * Andre Lamothe
Advertisement
Quote:Original post by ArmitageIII87
I personally prefer Trolltech's Qt...but that's just me.


Just keep in mind that Qt is not free for commericial use:Qt Licensing

If you where previously into MFC, it might be worth checking out the new controls Microsoft just released in the Visual C++ 2008 Feature Pack:

Get a feel for the new MFC features using samples
Visual C++ 2008 Feature Pack Released!

You can still design Win32 dialogs in VS 2008 as Mike said. However, you could probably build the same app with C# in a fraction of the time. Mainly because the .NET Framework wraps up many of the tedious tasks.
Quote:Original post by rolkA
There is no such RAD features for native C++ applications in Visual Studio 2008.
Quote:Original post by daviangel
The closest thing you'll find in VS2008 for C++ is winforms.

Wrong.

You can use ATL. I'm surprised nobody in this thread has even mentioned it.

The ATL dialog editor is much like the WinForms editor. You drag and drop controls, change their properties, and assign event handlers. This is what I use for my own C++ projects.

Unfortunately the ATL designers aren't available with VS express. I know they come with VS professional.

Screenshot

Example on CodeProject
Ra
Quote:Original post by ukdeveloper
...and the code is absolutely horrendous, it needs to be seen to be believed.
I thought you were talking about the auto-generated C# dialog code for a second there - I can't stand the sight of that stuff!
Quote:Original post by Ra
Quote:Original post by rolkA
There is no such RAD features for native C++ applications in Visual Studio 2008.
Quote:Original post by daviangel
The closest thing you'll find in VS2008 for C++ is winforms.

Wrong.

You can use ATL. I'm surprised nobody in this thread has even mentioned it.

The ATL dialog editor is much like the WinForms editor. You drag and drop controls, change their properties, and assign event handlers. This is what I use for my own C++ projects.

Unfortunately the ATL designers aren't available with VS express. I know they come with VS professional.

Screenshot

Example on CodeProject

I was purposely talking about VS2008 since that's what the OP mentioned he was using:

"
ATL Server is no longer under active development by the Visual C++ team and will not be included in VS2008 or any future version of Visual Studio. Future development of ATL Server will be done as part of a shared source project on CodePlex.com, http://www.codeplex.com/AtlServer/. If you are interested in contributing to this project or wish to request a new feature in this version of library, please contact the coordinators of the project on CodePlex.com.
"

Noone mentioned it because there is no use beating a dead horse. It'd be like recommending MDX...
Besides if you went the ATL you are putting another prereq i.e. COM that the OP has to learn.

[Edited by - daviangel on July 8, 2008 3:21:19 AM]
[size="2"]Don't talk about writing games, don't write design docs, don't spend your time on web boards. Sit in your house write 20 games when you complete them you will either want to do it the rest of your life or not * Andre Lamothe
Quote:Original post by daviangel
I was purposely talking about VS2008 since that's what the OP mentioned he was using:

"
ATL Server ...
"

Noone mentioned it because there is no use beating a dead horse. It'd be like recommending MDX...

They've discontinued ATL Server, not ATL. ATL exists in VS2008, along with all its wizards and designers. I am currently using it.
Ra
You absolutely don't need anything (apart if you can't program)
In a few lines of C ou C++ code and Win32 api, you can do everything in a few minutes.
Especially for Dialog Boxes, you just have to use the Dialog Editor... and draw.
Only kids use external libraries for so basics tasks !
I really appreciate all of the feedback everyone. I'm going to have to digest all of your suggestions and see what ends up working for me. Thanks!
Quote:Original post by george135
Only kids use external libraries for so basics tasks !


Unless, you know, you want to do stuff which someone has already rewritten and don't fancy remaking it.

To the OP;
If you have the time picking up C# can be worth while. With basically no experiance with the language I knocked up a C# + GDI+ app on sunday night to begin testing some stuff (including dragging things around with the mouse).

It really is easy if you've got C++ experiance and experiance with doing GUI stuff in general.
Using the Project Wizard to create a Win32 Application is the way to go. You can get it to generate the basic skeleton for you in seconds. All you have to do next is add some controls to your dialog (with the dialog editor.) and then write the code to make it do stuff. The process is super easy.

I think using C#, .NET or MFC for a task this simple is overkill.

This topic is closed to new replies.

Advertisement