Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Web GUI for C++ console application?

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.

like image 606
bobmichael Avatar asked Oct 25 '11 18:10

bobmichael


People also ask

How do I turn a console app into a GUI application?

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.

How to create a C++ GUI application?

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.

What is /consolegui?

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.

How to call console from MFC GUI?

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.


3 Answers

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.

like image 106
Basile Starynkevitch Avatar answered Oct 07 '22 16:10

Basile Starynkevitch


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.

like image 30
mloskot Avatar answered Oct 07 '22 16:10

mloskot


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.

like image 29
scrappedcola Avatar answered Oct 07 '22 18:10

scrappedcola