Create C++ GUI project

Bryan Kelly 401 Reputation points
2025-02-13T04:21:25.4333333+00:00

Windows 11, VS Professional 2019, Version 16.11.44, C++

I want to create a project that starts up with a GUI.

Select project template:  Windows Desktop Application.  The text states:  A project for an application with a graphical user interface that runs on Windows.  The options are: C++, Windows, Desktop.

Create that project, do an immediate build and run.  It opens what looks like a console window.  It does not open a GUI.

I suspect the basic looping function to service a GUI is not present.

Look in Solution Explorer -> Header Files, Resource files, Source Files and there is nothing that looks like a blank GUI to edit. 

Look in Resource view -> Dialog and the only item there is only IDD_ABOUTBOX

Looking through all the template options does not reveal anything that looks like I need.

What are the steps to create an application with a GUI?  A GUI that can be edited with the “Toolbox” and drag and drop tools?

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
5,443 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,857 questions
{count} votes

5 answers

Sort by: Most helpful
  1. RLWA32 47,206 Reputation points
    2025-02-13T08:02:53.4666667+00:00

    If you wait for Visual Studio 2019 to finish everything (including background tasks) when it creates a new Windows Desktop Application the following is what you should see after expanding the Header Files, Resource Files and Source Files nodes in Solution Explorer.

    VS2019_Windows_Application

    I suggest you completely delete whatever you were previously working with and try again. Before attempting to Build and Run the project post a screenshot identical to the above so we can see what you are working with.


  2. Minxin Yu 12,676 Reputation points Microsoft Vendor
    2025-02-13T08:06:00.7366667+00:00

    Hi,

    The basic GUI project:
    Windows Desktop Application

    enter image description here

    User's image

    It opens what looks like a console window.

    Can you provide more information, a screenshot of the running program. There may be multiple projects in the solution and the GUI project is not executed.

    GUI editing is available for dialog box instead of Window.

    You may need MFC Dialog based project.

    Best regards,

    Minxin Yu


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  3. Castorix31 86,986 Reputation points
    2025-02-14T08:35:01.3133333+00:00

    What are the steps to create an application with a GUI? A GUI that can be edited with the “Toolbox” and drag and drop tools?

    You can also use C++/CLI with WinForms, where you can drag/drop controls on the main Form, as explained in the archived thread : Create C++ Windows Forms application in Visual Studio 2017

    (it works too with other VS versions)

    0 comments No comments

  4. Bryan Kelly 401 Reputation points
    2025-02-15T05:52:35.73+00:00

    Several years ago, I very distinctly remember using VS C++ such that it created a default and simple Windows / GUI project.  Without writing any code or adding any extensions, the selected project template opened up a GUI ready to use.  I then opened the "Toolbox," dragged some controls on the GUI, compiled, ran, and there they were.  All the support software to monitor for things such as button clicks was already present. Where do I find such a project in VS 2019?  Do I need to upgrade to something later?

    0 comments No comments

  5. RLWA32 47,206 Reputation points
    2025-02-15T08:06:57.1566667+00:00

    It sounds like you had created an MFC dialog-based application.

    Open the Visual Studio Installer and click Modify to display the installed workloads.

    Under the "Installation Details" pane expand the node for "Desktop Development with C++".

    Select the two components (MFC/ATL) as highlighted in the image below and install them.

    MFCandATL

    When the installer has finished, close it.

    Now you should be able to run VS2019 and see the choice for "MFC App" when you want to create a new project. While the new project is being created in the MFC Application Type window choose "Dialog based" in the Application type dropdown as highlighted in the image below. When the new project creation is complete you should have what you want

    ApplicationType

    .

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.