Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   C++ Windows Programming? (http://www.chiefdelphi.com/forums/showthread.php?t=76241)

basicxman 28-03-2009 00:02

C++ Windows Programming?
 
Hey everyone, I'm wanting to learn C++ (I have a basic knowledge of it already though, unfortunately it's mostly forgotten though) and using it to make windows applications with a GUI. Preferably free online material, does anybody know where to start? Thanks! Programming Level: Novice

basicxman 28-03-2009 00:04

Re: C++ Windows Programming?
 
Oh. P.S. Yes I've used microsoft's visual express stuff, didn't like it much and I would like to learn something used in the real industry, more powerful, and that doesn't give you all the hard code for you XD

RyanN 28-03-2009 00:27

Re: C++ Windows Programming?
 
The only free solution that I know of that gives you a GUI is... Visual Studio Express C++...

All I use in college is the command line, which can be programed with virtually anything. Dev-C++, Visual Studio, and my personal favorite, Xcode (for OSX).

basicxman 28-03-2009 01:05

Re: C++ Windows Programming?
 
I've been going to cprogramming.com, excellent resource. As for compilers, Dev-C++, have been using this for years (well, spanned out over years). Can't you make a GUI with the windows API???

Bongle 28-03-2009 09:12

Re: C++ Windows Programming?
 
If you want to do the REAL low-level stuff, then you want to learn the Win32 API, where you handle messages in what is called a WndProc and use SendMessage to change your UI state. I can assure you that there are places in industry that do this, though there is a strong and growing tendency to make GUI-heavy apps out of something a bit easier to use than C++/Win32 (in particular C# or using something other than Win32, like MFC or WPF).

What's cool about Win32 is that you can make some pretty expansive apps with very small executables. Though I'm not sure, I bet that uTorrent is made with low-level Win32, which explains its microscopic binary size.

Anyway, although I don't have a tutorial to start from, I can tell you a few keywords to go from:
-You want to make a dialog. You'll need to make a parent-window first, but just about any IDE (Code::Blocks, Visual C++) has a project template that will create your window for you.
-You make the dialog in the resource editor, give the elements of it identifiers, and then can refer to those identifiers in code
-You'll want to make very heavy use of MSDN. Here's a good starting point: http://msdn.microsoft.com/en-us/libr...79(VS.85).aspx

FRC4ME 28-03-2009 09:40

Re: C++ Windows Programming?
 
"The industry" uses Visual Studio quite often (although C# and VB are more popular choices than C++).

Why spend time and money writing something that you don't have to? Sure, its a fun mental exercise to learn the low-level stuff, but in today's fast-paced competitive environment, anything that does not require you to do so is an important tool.

ComradeNikolai 28-03-2009 14:06

Re: C++ Windows Programming?
 
You might want to look into using GTK (or GTKmm), QT, or WxWidgets. They're GUI libraries that you can use with C++. GTK also has a GUI editor for it you don't want to hard-code EVERYTHING, but you still have that option available.

Nathan 28-03-2009 17:35

Re: C++ Windows Programming?
 
I would recommend using WxWidgets. It's free, where Qt costs *I think* a few thousand dollars to use.

There's also a great forum available: http://wxforum.shadonet.com

I've just about completed my first C++ application with a GUI, using WxWidgets. There are two screen shots on this page: http://roboticsguy.com/software/dspi...-communicator/

brianelite 28-03-2009 18:39

Re: C++ Windows Programming?
 
I believe QT is free for non commercial use and maybe even free for commercial use now. After all KDE is using QT.

For Windows you can use wxdevc++ it is a devc++ based wxwidgets programming ide. Unfortunately I think wxwidgets is needlessly complex so I do not use wxwidgets... but maybe you will like it?

Nathan 28-03-2009 20:07

Re: C++ Windows Programming?
 
OK, I just checked on the Qt website. It looks like they do have a free version available under the LGPL license. But, if you ever decide you want to sell one of your programs with Qt, you'll have the pay the 4K licensing fee.

WxWidgets has a lot of features, maybe that's what you mean by complex?

If you decide to try out WxWidgets, use the "WxPack," not the "real" version where you have to build the library yourself.

http://wxpack.sourceforge.net/

brianelite 29-03-2009 02:38

Re: C++ Windows Programming?
 
Alternatively you could use a customized build of devC++, that you are already familiar with but with enchantments for wxwidgets.

http://wxdsgn.sourceforge.net/

Nathan: If you look at Qt and WXwidgets I think Qt has much more intuitive classes and easier ways of doing things. with wx it seems to me like everything is crytically named and you need to memorize completely unintuitive things. But thats just my opinion. I haven't done much development with wxwidgets (only basic examples).

If you go to zetcode.com they have examples that do the same thing in QT, gtk, wxwidgets ect... I think wxwidgets is the most unintuitive. But you can decide for yourself. Whatever works for you is the best.

basicxman 29-03-2009 15:38

Re: C++ Windows Programming?
 
Thanks everyone. Currently I'm just working with console applications but I tried making a window with win32 and it wasn't so bad...lots of customization

virtuald 29-03-2009 18:45

Re: C++ Windows Programming?
 
I created my GUI WPILib Test Harness (allows you to run your bot code on your computer) using wxWidgets. http://www.chiefdelphi.com/forums/sh...ad.php?t=75811

wxWidgets has a nice option called XRC, that allows you to design the GUI part separately from the code and change it after compile time. Tools like wxFormBuilder allow you to modify the XRC files in a WYSIWYG style.

KevinRo 29-03-2009 20:12

Re: C++ Windows Programming?
 
Quote:

Originally Posted by basicxman (Post 841793)
Oh. P.S. Yes I've used microsoft's visual express stuff, didn't like it much and I would like to learn something used in the real industry, more powerful, and that doesn't give you all the hard code for you XD

You will find that Visual Studio is, by a pretty large margin, the most used compiler in industry. Most everything you will use in Visual Express will be applicable to Visual Studio. So, if you want industry, you want to start with Visual Express.

There are other free tools out there as were listed in the other replies. A few are pretty good. Most are, well, written to be free and not as feature rich or as reliable as the Microsoft offering.

If you want to learn the programming language, I highly recommend writing a Win32 console applications for a while. The GUI stuff on any platform may distract you from learning the basics of the language. Everything you learn about the C++ language in a console application will be 100% applicable when you get ready to write a GUI application.

Kevin

Nathan 31-03-2009 12:34

Re: C++ Windows Programming?
 
If you're a student, you can get Visual Studio for free! :D

https://downloads.channel8.msdn.com/Default.aspx

gvarndell 31-03-2009 14:25

Re: C++ Windows Programming?
 
Sorry if this has been suggested already...


http://wiki.eclipse.org/index.php/CDT

ay2b 31-03-2009 14:31

Re: C++ Windows Programming?
 
Quote:

Originally Posted by basicxman (Post 841792)
Hey everyone, I'm wanting to learn C++ (I have a basic knowledge of it already though, unfortunately it's mostly forgotten though) and using it to make windows applications with a GUI. Preferably free online material, does anybody know where to start? Thanks! Programming Level: Novice

My recommendation is to first learn the language, and then learn how to add a GUI.

The book I recommend for learning the language is C++ How to Program (ISBN-13: 9780136152507) or C How to Program (ISBN-13: 9780132404167). This is the book I used to learn C. There are probably lots of other good ones out there, but from first-hand experience, I can say that C How to Program is a top-notch book. It has lots of tutorials and problems and exercises for you to work through. Once you rate yourself above "Novice" level, then learn how to add a GUI. Unfortunately, neither of these books are cheap (you certainly don't need both), but you may be able to find one at a used book store for much less (especially if it's an older edition).

Alan Anderson 31-03-2009 14:53

Re: C++ Windows Programming?
 
Quote:

Originally Posted by ay2b (Post 843833)
My recommendation is to first learn the language, and then learn how to add a GUI.

I'm going to speak out against that recommendation.

A good GUI really wants to have the program written around it, rather than putting a GUI on top of a program. The event-driven model adopted by most GUI frameworks is something that needs to be considered from the beginning. If the goal is to write fully-functional and easy-to-use Windows applications, I would suggest starting with the GUI features right away, incorporating the necessary programming idioms and following high-level examples. Once the basic shape of the framework is known and mostly understood, then the task of closely studying the language in context can be fruitful.

basicxman 01-04-2009 14:08

Re: C++ Windows Programming?
 
I'm currently going through Sams Teach Yourself C++ in One Hour a Day, sort of a 888 page bible on C++. It's extremely well written with lots of good stuff. GUI is the next step afterwards... I'm probably going to use DirectX or OpenGL

ay2b 01-04-2009 14:58

Re: C++ Windows Programming?
 
Quote:

Originally Posted by Alan Anderson (Post 843843)
A good GUI really wants to have the program written around it, rather than putting a GUI on top of a program.

I agree. What I meant was that I believe one should first learn the structures of the language -- how do pointers work? what are linked lists? what are queues? what are objects? how does inheritance work? etc -- before learning all the GUI functionality. I meant that one would "add GUI programming to their body of knowledge", not that they would "add a GUI on top of an existing program". I probably wasn't clear on that point.

Quote:

Originally Posted by Alan Anderson (Post 843843)
The event-driven model adopted by most GUI frameworks is something that needs to be considered from the beginning. If the goal is to write fully-functional and easy-to-use Windows applications, I would suggest starting with the GUI features right away, incorporating the necessary programming idioms and following high-level examples. Once the basic shape of the framework is known and mostly understood, then the task of closely studying the language in context can be fruitful.

Everyone learns differently. In my opinion, the more linear nature of simpler non-GUI programs is easier to understand that the event-based, message passing model of most GUI frameworks. To other programmers, the event-based model might make more sense.

Kruuzr 01-04-2009 20:56

Re: C++ Windows Programming?
 
Quote:

Originally Posted by Nathan (Post 841972)
OK, I just checked on the Qt website. It looks like they do have a free version available under the LGPL license. But, if you ever decide you want to sell one of your programs with Qt, you'll have the pay the 4K licensing fee.

WxWidgets has a lot of features, maybe that's what you mean by complex?

If you decide to try out WxWidgets, use the "WxPack," not the "real" version where you have to build the library yourself.

http://wxpack.sourceforge.net/

You need to look into LGPL further. You do NOT have to pay for licensing if you want to sell a program later!

I will put in a huge word for Qt here. I've been using it for the last 5-6 years at work for cross platform development. Previous to this, I had used Microsoft MFC and also some other cross platform libraries. Qt is by far the best thought out and most comprehensive solution, and it's now free. I've convinced a few people to spend a weekend with Qt and a 'programming with Qt' book, and they've all been able to get started quickly. Certainly much faster than with straight windows calls or MFC. It was written by programmers for programmers and it shows in the logical design. The extras, such as networking, xml, database, and so on are just great extras.

Steve

Nathan 02-04-2009 14:13

Re: C++ Windows Programming?
 
Wow! Thanks Steve! I didn't know the difference between GPL and LGPL before your post prompted me to check. I had no idea Qt was available for commercial apps, for free.

Time to check out Qt :)

Do you have any specific books you would like to recommend?

slavik262 02-04-2009 23:57

Re: C++ Windows Programming?
 
Andy, I was in almost the same place you were around this time last year. I was learning C++ and wanted to move on to some GUI programming.

For basic C++ turtorials, www.learncpp.com worked as an awesome tool for me.

As for Windows API and GUI work, this tutorial got me off the ground:

http://www.winprog.org/tutorial/

Visual Studio is an awesome IDE in my opinion, regardless if you're just doing console work or doing GUI stuff. It also has MSDN help built directly into it, which is extremely useful while doing Windows API work. You can the express version for free at http://www.microsoft.com/express/download/

Best of luck.


All times are GMT -5. The time now is 13:04.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi