GUI programming for VC++  | |
December 15th, 2005, 01:33 PM
|
#1 (permalink)
| | Senior Member
Join Date: Oct 2001 Location: New Hampshire, USA
Posts: 641
| GUI programming for VC++
I know how to do LI programming in Microsoft Visual C++ 6.0, but would like to learn how to create a GUI to drive C++ events. Does anyone have a good tutorial to teach me how to create a form and add controls?
As an asside, I have been doing VB event driven GUI programming for some time but the VC++ development environment is a little too different for me to figure out where to begin.
Any help would be appreciated. |
| |
December 15th, 2005, 01:38 PM
|
#2 (permalink)
| | I am a banana!
Join Date: Jun 2002 Location: Texas Tech
Posts: 3,921
|
It's much much different than you think.
There are two methods to programming a GUI in C/C++ for windows: directly using the Win32 API (which is straight C) and using MFC (which is C++ and is a wrapper class around the API).
I would recommend starting with the Win32 API. It's very difficult to use, but it forms the basis for MFC and MFC is quite confusing if you don't understand the Win32 API.
Be prepared, this is not like programming in VB. It took me about a month just to understand the API. As an example, to create a basic notepad like program (without any of the menu options...just being able to type) takes about 100 lines of code. Also, be prepared to use LOTS of pointers in both the API and MFC and using things like multiple inheritence and deriving one class from another in MFC (i.e. advanced class stuff).
My best advice is to do a google search for "win32 api tutorial".
EDIT: if you want, I can give you the first real win32 api program I wrote, a program for controlling a serial based LCD, so that you can see what the code looks like. This method didn't use a form, although you can use forms. It doesn't really make things that much easier IMO unless you're doing a really complicated interface.
Last edited by originel : December 15th, 2005 at 01:41 PM.
|
| |
December 15th, 2005, 02:16 PM
|
#3 (permalink)
| | Senior Member
Join Date: Oct 2001 Location: Eastern Shore
Posts: 701
|
I first attempted MFC but quickly realized how much more difficult it was without an understanding of the Win32 API. So I am currently learning that before moving onto MFC.
I highly recommend Windows Programming by Charles Petzold to learn about the API. Very in-depth but excellently written, making it easy to understand. I originally tried the online tutorial route and found them far too vague to be of any real use.
When I get to MFC (learning this stuff in my spare time), I will probably use Programming Windows with MFC by Jeff Prosise. I have heard excellent reviews on that book also. Both are published by Microsoft Press.
ILC |
| |
December 17th, 2005, 11:53 AM
|
#4 (permalink)
| | Junior Member
Join Date: Dec 2005
Posts: 1
| Quote: |
Originally Posted by ILC ..................
..........................
I highly recommend Windows Programming by Charles Petzold to learn about the API. Very in-depth but excellently written, making it easy to understand. I originally tried the online tutorial route and found them far too vague to be of any real use.
When I get to MFC (learning this stuff in my spare time), I will probably use Programming Windows with MFC by Jeff Prosise. I have heard excellent reviews on that book also. Both are published by Microsoft Press.
ILC | That are The Bibles in the Windows Programming ! |
| |
December 18th, 2005, 10:06 AM
|
#5 (permalink)
| | Senior Member
Join Date: May 2003 Location: Aus, Gold Coast :)
Posts: 802
|
MFC is your friend....
depends at what depth u want to get into, if u want the basic drop down menus etc etc like a standard program MFC is fine, but as they said to understand it alot better look at thew win api, when using MFC remember
UpdateData(true);
.
.
.
UpdateData(false);
is your bestest buddy |
| | | Thread Tools | Search this Thread | | | | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | | | | Most Active Discussions | | | | | Recent Discussions  | | | | | |