MFC and Scripting? - mfc

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...

Related

Building Web app with existing cpp core code

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.

Using box.net, dropbox, (OR ANY cloud storage) with a C++ application

How do you use cloud storage such as Dropbox in your C++ Apllication ? I've checked out their API and they only have Java, Python, and Ruby options. If you cant use dropbox with a c++ app, is therte any cloud storage provider that has an API for C++.
The drop box APIs seem to be wrappers for a http interface.
So if you want to hit them up from C++ you can use a http supporting library like libcurl to access stuff using the REST api
Droper is an open source C++/Qt Dropbox client that I have recently wrote. It can be compiled for Windows and Linux, but the GUI is optimized for Symbian mobile phones. Check it out.
I've found several differnet APIs on their website, righ under the place you propably found the ruby / pathon stuff..
http://sharpbox.codeplex.com/
http://github.com/dkarzon/DropNet
Not sure if this is, wha you were looking for..

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

Can I use XPCOM to create and manipulate a Firefox window as I would use win32 COM with IE?

With win32 COM I create an Internet Explorer instance and control it almost fully from my python code (manipulate windows, DOM elements, etc). More specifically, using DispatchEx('InternetExplorer.Application'). Can I do the same using XPCOM and C++/python?
I need to automate certain actions taken on the html ui of some websites, so no I can't use urllib and I can't use selenium, because it doesn't work with cross-domain urls. I've wrote a wrapper class for Internet Explore where I can create a browser window and do anything with it, but I would like to do the same with firefox as well. I've thought about creating a XUL application that exposes the DOM functionality through a tcp server written in XUL/js. I'm not even sure that's possible, but if I can do everything from my python code without running xulrunner externally, much better.
I don't know about programmatically creating and controlling full Firefox instances, but Mozilla can definitely be embedded using XPCOM.
The Mozilla embedding FAQ, embedding how-to and the embedding APIs overview should get you started. There are also other means for embedding.
I have used the nsIDOMXULElement to attach event listeners in my XPCOM C++ code. I haven't tried modifying the UI, but it will probably work as well.
For an example on how to get an nsIDOMXULElement look at the call "SetVideoWindow" in Songbird's code here.

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!