Have an amazing solution built in RAD Studio? Let us know. Looking for discounts? Visit our Special Offers page!
C++CodeIDE

How To Use The Windows UI toolkit With A C++ Compiler

How To Use The Windows UI toolkit With A C++ Compiler

If you want to develop a professional Windows application, you need a good quality C++ IDE and C++ compiler that you can use to edit and compile your code to an executable Windows application. Maybe you are very good at C++ programming console applications but you don’t know how to switch up a gear to use the C++ Compiler to create a GUI. In this post, we explain simply how you can start to build wonderful windows applications with GUIs.

Which C++ IDE do I need to develop Windows apps?

An integrated development environment (IDE) is a software application that provides a complete set of features for application development. Code is written in text format, and you can easily edit or modify your C++ code ‘the hard way’ using text editors like Notepad, Word, and WordPad or use something more powerful such as UltraEdit. For a developer who is going to spend any real amount of time writing code, however, an IDE is really important because features like syntax highlighting, auto code completion and a context-sensitive help system, along with the opportunity to run, test, debug, deploy, merge or transform code on other platforms (multiplatform coding) are also important, perhaps even vital. All these capabilities require a comprehensive C++ IDE.

C++ is a powerful programming language and one of the world’s most with many ready-made variables, functions, methods, namespaces and libraries to enable you to write almost any app you could ever want. Using a fast and reliable C++ Compiler and IDE is very important for beginners and professionals to develop C++ apps for Windows and other operating systems. When a user wants to develop modern C++ applications, they should learn to use a professional IDE. In this post we explain the basics of C++ Builder as a guide for beginners.

Software IDE to turn software ideas into reality - RAD Studio
cbuider_studio_final_icons_64-7772010-6139887

If you are new to C++ and want to compile code for the first time we recommend you try the free C++ Builder Community Edition for students, beginners, and startups. C++ Builder is the easiest and fastest C and C++ IDE for building simple or professional applications on the Windows, macOS, iOS & Android operating systems. It is also easy for beginners to learn with its wide range of samples, tutorials, help files, and LSP support for code. C++ Builder comes with Rapid Application Development Studio, also known as RAD Studio, and C++ Builder is one of the most professional IDE’s that work under RAD Studio. More details about C++ Builder & RAD Studio for the beginners can be found in Official Wiki of Rad Studio.

Here are the features of the C++ Builder CE version;

  • Build Windows and iOS C++ Applications 10x Faster with Less Code.
  • C++Builder Community Edition provides you with an integrated toolchain and professional-level developer tools from Day 1
  • Featuring Clang-enhanced compiler, Dinkumware standard library, MSBuild/CMake/Ninja support, and popular libraries like Boost and Eigen.
  • Develop Windows and iOS applications with a single codebase and responsive UI
  • Enjoy the award winning Visual Designer using the C++Builder VCL and FireMonkey frameworks for maximum productivity
  • Built-in Debugging Tools that allow you to debug on any device
  • Build database apps with local/embedded capabilities
  • Hundreds of included components to enhance your app and reduce development cycles
  • Direct access to InterBase, SQLite, MySQL, SQL Server, Oracle, PostgreSQL, DB2, SQL Anywhere, Advantage DB, Firebird, Access, Informix, MongoDB, and more.
  • Licensed for use until your individual revenue from C++Builder applications or company revenue reaches $5,000 US or your development team expands to more than 5 developers

Become a master C++ developer and learn about one of the most powerful languages in the programming world.

How to create a new C++ Project with a GUI?

If you download C++ Builder Community Edition (or RAD Studio CE version) or any Professional, Architect, Enterprise versions of C++ Builder. Install it on your windows computer and run RAD Studio or C++ Builder. Beginners and students normally start to learn C++ with simple code.

In C++ Builder, choose File->New-> “Multi-Device Application – C++ Builder” menu.

rads11-1w_create_multi-device-8017435

This will create a New C++ Project for Windows and can be easily compiled for other operating systems like iOS , Android. This will allow you develop C++ apps with FMX UI elements. If you don’t need UI Elements, this means you don’t need VCL or FMX frameworks, you create a console application too. Modern applications have a GUI’s and skinned Styles. Note that VCL projects are Windows only and FireMonkey projects are Multi Device (multi-platform) applications that you can compile and run on Windows, MacOS, iOS and Android .

Save all Unit files and Project file to a folder.

How to add UI elements to your form?

Simply drag and drop components from the Palette window on the right side; Memo (TMemo) and Button (TButton) to your form design. Arrange their width, height and position. You can edit each of their properties from the Object Inspector on the left side.

rads11-1w_helloworld_fmx__memo_button_ui_shadowed-7136287

Note that you can switch between the GUI Design mode to Code Mode by pressing F12, or vice versa.

How to add your C++ code to the program?

Double click on Button1 to create OnClick() event for this button. Add these lines into the Button1Click() event,

This example above is a modern “Hello World” example for Windows which runs with C++ Builder.

How To Use The Windows UI toolkit With A C++ Compiler  an example screen

How to compile your C++ project and run it in the C++ IDE?

Now you can compile this C++ code; just press the F9 key or just click the Run button in the center of top bar. This will let the IDE check your code for errors and compile both the Unit and project files and link them together. You can also use the Run menu from the top to run your application. You should see this below as a form application

rads11-1w_helloworld_fmx__memo_button_run-7127049

If you get an error, check your code – it’s easy to mistype or have the braces (“}” characters) in the wrong place. The C++ IDE should highlight any lines that have errors and give you a brief explanation of what it thinks is causing the error. Note that C++ is case sensitive, so upper and lower characters for classes, objects and other identifiers have to match their definitions. Then press the F9 key or just click the Run button again.

From this point, you can add more code or you can switch back to design mode by pressing F12. You can add more components simply by dragging them from the component palette. This is how modern C++ coding works with a UI Toolkit. C++ Builder and RAD Studio makes it easy.

If you succeed in the steps above and want to know how to compile modern and visual application in VCL, you can do same with a VCL application. Note that VCL applications are only for Windows operating system, you can not compile for other operating systems. There are slight changes between VCL and FMX components.

Switch to a better built tool box like a professional C++ compiler and develop small applications for different platforms for free.


cbuilder_11_512x5121x-7286189-8695819

You can download the free C++ Builder Community Edition here: https://www.embarcadero.com/products/cbuilder/starter.

Professional developers can use the Professional, Architect or Enterprise versions of C++ Builder. Please visit https://www.embarcadero.com/products/cbuilder.

The latest posts along with more examples and tutorials can be found here on the Embarcadero Blog with this dynamic search https://blogs.embarcadero.com/?s=C%2B%2B and in LearnCPlusPlus.org


What's Coming in Delphi, C++Builder, and RAD Studio 11.2 Alexandria

Reduce development time and get to market faster with RAD Studio, Delphi, or C++Builder.
Design. Code. Compile. Deploy.
Start Free Trial   Upgrade Today

   Free Delphi Community Edition   Free C++Builder Community Edition

About author

Dr. Yilmaz Yoru has 33+ years of coding with more than 30+ programming languages, mostly C++ on Windows, Android, Mac-OS, iOS, Linux, and other operating systems. He was born in 1974, Eskisehir-Turkey. He graduated from the Department of Mechanical Engineering of Eskisehir Osmangazi University in 1997. One year later, he started to work in the same university as an assistant. He received his MSc and Ph.D. degrees from the same department of the same university. Since 2012, he is the founder and CEO of Esenja LLC Company. Some of his interests are Programming, Thermodynamics, Fluid Mechanics, and Artificial Intelligence. He also likes the graphical 2D & 3D design and high-end innovations. He has married, and he is a father of a son.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

IN THE ARTICLES