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.
6 Responses to Code::Blocks C++ Win32 API Frame Menu Primer Tutorial