Building Web app with existing cpp core code - c++

I have an Android/iPhone apps that share the same cpp core engine.
I want to use the same cpp core engine in the web app in some way.
I wonder what are my options? What is the best approach?

If you want to re-use the existing C++ code, then depending on your platform you can write a CGI (Common Gateway Interface) extension for your favourite web-server.
If your platform is Windows, you can also write an ISAPI extension DLL in C++ and access your core library from there.

Related

How to add web interface to c++ project

I have an application built on C++ code and deployed on UNIX machine. I have one VB front end interface for this code which is communicating using CORBA (ORBIX).
Now I need to add new web interface to this existing application. How can I do this without changing much of the existing application and code.

How to write my own Javascript API (client-side) for a native code library (C/C++)

I must develop a Web App with HTML 5 and Javascript for client side. But i need to use the funcionalities that provides a client's native library (.dll/.so) to process some data on it´s machine with C/C++.
I like to write my own API in Javascript to access native library, like NodeJS's addons define, but those addons only are accessible from NodeJS (server-side).
Also there is a well established NPAPI but seems that Google's PPAPI wants to replace it: I could not decide on any of them.
Is there something similar to NodeJS's addons for client-side that allow me to focus only on C++, Javascript and HTML 5?
Thanks.
Not in any general sense. Addons for node.js are allowed because there is an implicit trust relationship between the author of the code and the person running it. (Indeed, they're usually the same person.) In web browsers, no such trust exists -- by browsing to a web site, you're letting whoever wrote that site run some code on your system. Since you (probably) don't trust them completely, what they can do in Javascript is restricted to a set of known safe actions. Loading DLLs is very much not in that set.
As generalhenry noted in a comment, there are some projects like emscripten to compile native code to Javascript, or Google Native Client to run sandboxed native code in the browser, but these technologies are still restricted in capabilities, and are pretty immature still. Ultimately, you will need to come to terms with the fact that code running in a browser is going to be limited.

Host a c++ desktop application on a webpage

I am having a desktop application which having a UI interface made in Qt linked with a library which is doing all the calculation stuff. Values from UI is taken and pass to the API's in the DLL to get the output which is shown on Screen.
Now i want to do the same thing by transferring my application UI to a web page so that people can access the tool from anywhere without any installation process.
I want to retain my c++ DLL code so i don't have to do a lot of work. I am thinking of just converting this DLL to a C++ server by any communication Process(Sockets). I want to host this application on my company's website. (We have to make the website also so we are open to any set of tools).
I want to know what will be the best set of tools to do this stuff. Also there will be lot of data exchange between the webpage and server so the wholething should be optimized also. I goggled a bit and find stuff like silverlight and ASP.NET, But i am still not very clear which option will be more suitable.
I am a c++ programmer with no web application development experience. I am open to learn any new technology.
Thanks
Why not use Qt on the web directly? There are several projects like this one: http://qtwui.sourceforge.net/
There is a netscape plugin that will host a QT application and an ActiveX control wrapper on the QT website. You could use one of those to wrap your application. Note that this approach would require the user (or their administrator) to download and install the plugin.
An alternative approach might be to run your application through a remote desktop such as XVNC, NX or an RDP based layer. IIRC browser based remote desktop clients are available for most such protocols.
A few options:
pick a messaging/queue implementation (like http://www.zeromq.org/) and provide a service
implement a Windows Web Service if you want to be more enterprise friendly: http://msdn.microsoft.com/en-us/magazine/ee335693.aspx
I would not expose the implementation on the internet. Enough to have a simple buffer overflow and the machine can be taken over quickly. Adding a layer between the app and the web provides an easy way to validate input, access, stats ...
You should be able to use your DLL from an wt or cppcms application. Then you do not have to learn something new and can just use C++.
The way I'm currently doing this is with Boost.Python + django

MFC and Scripting?

I have an MFC application.
What scripting library can I use to give users to access my application via scripting?
Can I do something like:
Use JavaScript + MFC and build a front-end using JavaScript and mini-HTML viewer in a single EXE?
Maybe this question should be:
I like server-side JavaScript and MFC/C++. Can I compile an embedded Javascript and execute it inside my MFC/Javascript shell front-end to present a Win32 app and script whole application logic via JavaScript?
It needs to be closed-source, so I cannot use GPL
The CodeProject article Adding Macro Scripting language support to existing MFC Application sounds promising...

Web interface for c++ applications

Our company has a set of 3d modeling softwares written in c++ with qt based gui. We are planning to offer these applications to customers to try them from a web browser. I mean to say, we need to create web interfaces for native c++ codes. Please suggest me which technology, languages should be used. If possible please give some links to some white papers or case studies for this kind of projects. I am totally clue less :)
Ideally you would keep your c++ code on the server and use a mixture of HTML and Javascript on the browser. However since 3d modeling is so client centric you may have to run some c++ code directly in the browser.
There are a few options to look at:
Emscripten
Adobe Alchemy
Google Native Client
A Java Applet using NestedVM
Netscape plugin API
ActiveX
You could also run a few instances of your application on your server inside an XVnc session and let people use it through a VNC viewer applet. The simplest solution however is still to offer a downloadable demo of your application.
Have a look at Wt
Take a look at Native Client.
Soon you might be use WebGL to do 3D in the browser. But how long it will take for browsers to include it I do not know. But it might be good to look at it to not rule out using it in the future.
If creating everything again is too expensive, always you can create a distributed application:
One program running the main application in C++ and generating (for example) XML files.
A web application reading the XML files generated by the C++ application and translating them into the web application language (for example Adobe Flex).
Good luck!