Code::Blocks C++ Win32 API Frame Menu Primer Tutorial

Code::Blocks C++ Win32 API Frame Menu Primer Tutorial

Code::Blocks C++ Win32 API Frame Menu Primer Tutorial

The tutorial today is about a programming IDE called Code::Blocks, and we use this to create a project to create a C++ Windows 32bit GUI frame application (Win32 API) with two simple submenus.

Programming IDEs take a lot of the hard work out of tasks such as compiling and linking in languages such as D, Matlab, Fortran (Code::Blocks) or Java, C, C++, VB.Net and C# (NetBeans) … and please know that there are many other languages and many other IDEs. In the case of Code::Blocks IDE, which this blog reintroduces to you today (its customary to shake hands, and no Klingon is necessary), it can create a C++ Win32 GUI project environment. To cut a long story short, there aint nothin’ wrong with a good ol’ IDE, but beware of IDEs in March.

In saying that about IDEs, and how they make programming easier, often with Open Source programming, it is advantageous to know what goes on “under the hood” (or even “in the ‘hood” … chortle, chortle). So if you ever get an opportunity to get helped creating your own makefile (or make it yourself, even with the Sweet Green Icing … knew it could be worked in!) for something, take the opportunity to learn how to do this, as the Open Source world will become a little easier to navigate with such types of knowledge. You’ve got to admire those early designers of computer languages, and those days when all you had was this tiny bit of memory (64k or “into the heliosphere on 8,000 bytes of memory”) to play with to create your program.

In today’s tutorial we write a simple C++ Windows 32bit GUI frame application with submenus. Digital Mars compilers were used here and an additional rcc.exe needed to be downloaded for the compilation of resource *.rc files required here, that is not included in a default Digital Mars installation.

Points of some interest are:

  • Use of Windows Environment variables where possible
  • Use of short names for non-8dot3 file names … rule of thumb for 90%+ of cases is short name = (first six of non-8dot3) + “~1″ (if a file, rather than directory, add file extension as well, here … eg. “%ProgramFiles%intern~1iexplo~1.exe” points at Internet Explorer web browser application on lots of people’s Windows computers)
  • Use of C(++) system function
  • Use of cmd.exe /c to call Internet Explorer to display a web page

Code::Blocks can be an IDE for much more than C++ and C … it can supervise D, Matlab, Fortran, ARM, AVR, Direct/X, FLTK, GLFW, GLUT, GTK+, Irrlicht, Lightfeather, MCS51, Ogre, OpenGL, PowerPC, QT4, SDL, SFML, STL port, SmartWin, TriCore and wxWidgets projects.

Link to Code::Blocks “spiritual home” download page at Code::Blocks.

Link to Digital Mars (extras) download page at Digital Mars.

Link to very good tutorial here … thanks … was followed very closely for this tutorial.

Link to some downloadable C++ code … rename to main.cpp
Link to some downloadable C++ header code … rename to resource.h
Link to some downloadable C++ resource file code … rename to resource.rc

If this was interesting you may be interested in this too.

This entry was posted in Code::Blocks, eLearning, GUI, Tutorials and tagged , , , , , , , , . Bookmark the permalink.

6 Responses to Code::Blocks C++ Win32 API Frame Menu Primer Tutorial

  1. subjects as well as discuss it with us. I think it will certainly help a lot of people. Many thanks

  2. I believe that a simple and unassuming manner of life is best for every person, greatest both for the body and the mind.

  3. Just a smiling visitor here to share the love (:, btw outstanding style and design. “Individuals may form communities, but it is institutions alone that can create a nation.” by Benjamin Disraeli.

  4. Excellent website. Lots of useful info here. I am sending it to a few pals ans additionally sharing in delicious. And certainly, thank you to your effort!

  5. kliknij says:

    I don’t even know how I ended up here fniovnvv, but I thought this post was good. I do not know who you are but certainly you are going to a famous blogger if you are not already ;) Cheers!

  6. I dugg some of you post as I cerebrated they were very helpful very useful

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>