Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 8 Replies) Create GUI project (Read 357 times)
bk13
Junior Member
**
Offline


Posts: 26
Joined: Aug 23rd, 2020
Create GUI project
Feb 13th, 2025 at 4:13am
Print Post  
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 windows.  It does not open a GUI.
Look in Solution Explorer -> Header Files, Resource files, Source Files and there is nothing that looks like a blank GUI to edit.  If not, I suspect the basic looping function to service a GUI is not present.
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?
Thank you for your time and patience.
« Last Edit: Feb 13th, 2025 at 4:17am by bk13 »  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2629
Joined: Feb 13th, 2019
Re: Create GUI project
Reply #1 - Feb 13th, 2025 at 10:11am
Print Post  
For standard GUI Windows Applications you will need to either create a WinForms,WPF or UWP application:
WinForms: https://learn.microsoft.com/en-us/visualstudio/ide/create-csharp-winform-visual-...
WPF: https://learn.microsoft.com/en-us/visualstudio/get-started/csharp/tutorial-wpf?v...
UWP:https://learn.microsoft.com/en-us/visualstudio/get-started/csharp/tutorial-uwp?v...

The WPF and UWP routes are much newer and handles various features (screen scaling etc) better than WinForms.  The tutorials above show how to get started with a basic application.
  
Back to top
IP Logged
 
bk13
Junior Member
**
Offline


Posts: 26
Joined: Aug 23rd, 2020
Re: Create GUI project
Reply #2 - Feb 14th, 2025 at 5:29am
Print Post  
Hello Simon,
All your suggestions are for C# but the question specified C++.

The first option you provided states it is for XAML and C#.  But maybe it will work for C++.  Browse through the tutorial and I don’t see anything that looks like a GUI with the ability to drag and drop controls onto it.

The second option is for WPF.   None have an option for C++

The third option is for windows Forms.  Looked at that template and it does not have a C++ option.

I will look some more but suggestions are solicited.
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2629
Joined: Feb 13th, 2019
Re: Create GUI project
Reply #3 - Feb 14th, 2025 at 9:56am
Print Post  
Apologies for missing the C++ specific element.

WinForms can be used with C++ as shown in the below Extension, and there are many examples online of how to do it with C++ specifically:
https://marketplace.visualstudio.com/items?itemName=RichardKaiser.CppWinfGUI

  
Back to top
IP Logged
 
bk13
Junior Member
**
Offline


Posts: 26
Joined: Aug 23rd, 2020
Re: Create GUI project
Reply #4 - Feb 15th, 2025 at 5:50am
Print Post  
Hello Simon,
Understood about missing the C++.
Your link led to stuff about extensions for Visual Studio.  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?
  
Back to top
 
IP Logged
 
bk13
Junior Member
**
Offline


Posts: 26
Joined: Aug 23rd, 2020
Re: Create GUI project
Reply #5 - Feb 18th, 2025 at 9:26pm
Print Post  
I followed instructions elsewhere and had to install MFC components.  Did all that then tried to create a new MFC project.  Almost all the defaults were taken but excluded ActiveX.  After clicking the Create button it complained “Cannot open file.” Then “Error HRESULT E_FAIL."  The first dialog was complete with the open file error, no details.  The second is posted. 
Oops, cannot figure out how to post an image.  The only image tool I see, third tool from left in top row, puts in some formatting characters such as [ img ] and [ /img ], but I don't know how to get an image in there.
The exact text of the error dialog is:  "Error HRESULT E_FAIL has been returned from a call to a COM component."  It has an OK button but nothing else.
When OK is clicked it goes back to the dialog is selecting a template for a new project.
Any suggestions?

« Last Edit: Feb 19th, 2025 at 1:55am by bk13 »  
Back to top
 
IP Logged
 
bk13
Junior Member
**
Offline


Posts: 26
Joined: Aug 23rd, 2020
Re: Create GUI project
Reply #6 - Feb 23rd, 2025 at 4:29pm
Print Post  
With no further answers posted I gave up and uninstalled VS 2019 then discovered I cannot find the install app for it.  Searches for 2019 produced results that said load one of several older versions, but always went to version 2022.
So found I had kept a 2017 install app and re-installed that.  Now am working on any path to create an app with a dialog.  Template Windows Desktop Application C++ appears to do that and provides no options.  Build the initial project, it appears to open a dialog.  
BUT, I cannot find the dialog to edit.
Well, keep searching and see what I can find.
« Last Edit: Feb 23rd, 2025 at 4:30pm by bk13 »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12169
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Create GUI project
Reply #7 - Feb 23rd, 2025 at 5:09pm
Print Post  
Open google gemini and enter this text:-

vs 2017 create a simple c++ application that shows two forms and show how to edit the forms
  
Back to top
IP Logged
 
bk13
Junior Member
**
Offline


Posts: 26
Joined: Aug 23rd, 2020
Re: Create GUI project
Reply #8 - Feb 26th, 2025 at 1:00am
Print Post  
Tim@Visual Micro,
Yes, that seems to have me going.  This will take a while.
Thank you for your time and patience.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint