Create C++ GUI project

Bryan Kelly 486 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?

Developer technologies C++
Developer technologies Visual Studio Other
{count} votes

6 answers

Sort by: Most helpful
  1. RLWA32 49,536 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 13,501 Reputation points Microsoft External Staff
    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 90,521 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. RLWA32 49,536 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

    .


  5. Bryan Kelly 486 Reputation points
    2025-02-26T04:06:59.0266667+00:00

    Quick review:

    Windows 11, Visual Studio 2017, Version 15.9.70, C++

    Top level goal: Create a simple project with dialogs and the ability to create and edit dialogs with the drag and drop controls from “Toolbox.”

    Creation steps:  Visual C++ -> Cross Platform -> MFC/ATL -> MFC App

    From right panel select MFC App

    Options:  Application type: Dialog based, ActiveX controls disabled, Finish

    Name test_mfc_01

    Build, run without debug, shows the dialog.

    Attempt to add a new dialog

    Instructions that have been found state … Add > New Item > Choose “Dialog Box”  Its not there.

    Step through the options of the left panel under Visual C++.  In the group for ATL is: ATL Dialog.  Select it and make a name: dlg_long_arithmetic and click Add

    Error message:  The project needs to include ATL support.

    Problem: At the very top I selected: Visual C++ -> Cross Platform -> MFC/ATL -> MFC App

    It says, right there, MFC/ATL.  It says ATL. 

    Oh, a look at all the options for Visual C++ reveal no other dialog options.

    What must I do different to be able to add a new dialog?

    &&&&&&&&&&&&&&&

    Try again

    Visual C++ -> Cross Platform -> MFC/ATL ->  ATL Project,  name is test_atl_01, OK  (Just to be clear, changed that final option in the right panel of the New Project dialog from MFC App to ATL Project.)

    Application type: Executable -> OK

    Build the project with no changes.

    Build, fail, error messages include:

    1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(1846,5): warning MSB3073: The command ""D:\vs_2017\test_atl_01\Debug\test_atl_01.exe" /RegServer" exited with code -2147319780.

    1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(1852,5): error MSB8011: Failed to register output. Please try enabling Per-user Redirection or register the component from a command prompt with elevated permissions.

    I have no idea of what that is trying to tell me and even less of an idea of how to correct it.

    Suggestions please.

    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.