I have a C++ project which I need to have some sort of GUI for, and I don't have time to learn something like the Win32 API (or qt or gtk for that matter).
So my question is: What options do I have for building a web-based GUI for my C++ console application? For example, is it possible to use HTML for the GUI and somehow embed my C++ code into the webpage?
Thanks.
Then, turning your your Console App into a GUI based application is as simple as instantiating your Form-derived class and calling .ShowDialog (). using System.Windows.Forms; //Note: if you create a new class by clicking PROJECT->Add Windows Form, //then this class definition and the constructor are automatically created for you.
To develop C++ GUI or C++ graphical user interface application, you need an IDE that supports the C++ GUI application. To create the GUI app, you must use Visual Studio 2019 because it is better suited for the C++ GUI application. In this tutorial, you will learn how to create a C++ GUI application in a detailed manner.
ConsoleGUI is a simple layout-driven.NET framework for creating console-based GUI applications. It provides most essential layout management utilities as well as a set of basic controls. The example above is not really a playable chess game. The board on the left is simply just a grid with some text in it - it's here for display purposes only.
if you want your GUI application to call the console applications exe you can use shellexecute ()function. Making GUI for an application is a complex task by itself (and you tagged MFC, to make it good looking, i guess). Imagine that your big and good looking MFC GUI application would be calling relatively small console to do some dirty job.
Did you consider using the Wt web toolkit? It is a C++ library to give a Web user interface to a C++ program.
You could also use some HTTP server library like libonion.
Check CppCMS framework. It makes it easy to implement Web services in C++, handle requests and output responses, also with HTML templates. Simply, server-side embedded C++ scripting capability.
Web based gui's run on the client side and code is limited to Javascript. To run C++ on your site you would need to set up a server that can make calls to the C++ code via the console and accept the output from console. Then you would have to communicate that information to the client using page posts or ajax calls.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With