Site icon Embarcadero RAD Studio, Delphi, & C++Builder Blogs

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.

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;

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.

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.

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,

[crayon-6746914599da8371258600/]

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

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

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.


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

Exit mobile version