Using GDI+ vs HTML page - c++

I am working on an application which is UI intensive (i.e. we need to customize all the control to look different).
For this is I planned to use GDI+ in win32. But one of the suggestion form our team member is,
Instead of using GDI+ he asked me to have a web browser control, in that he asked me to display local html.That html page contains customized controls.
Form his suggestion I created a web control and used some UI intensive local html pages. That looks good.
But my question is, is it is a good idea to use web control to solve this?

Using a web browser control to solve this problem is common. There are many applications out there that already do this. For example Steam uses Chromium instead of the web browser control to do all its window skinning. Windows 8 metro is another example of an HTML-based interface. There are even entire frameworks built on html-based interfaces such as Appcelerator. There are many benefits to going the web browser control route but it is not easy to get it right.

Related

Is there MSHTML Editing equivalent in MS Edge?

I want to use MS Edge as an html editor. Is that possible?
Can I use c++ to access undo stack?
If so, please point me to any kind of documentation.
Thanks
I don't have any sources for this, but I'm pretty certain that Microsoft didn't carry this functionality over into Edge - especially considering that you can't embed Edge in a C++ or .NET desktop application the same way you can with IE.
I don't see any reason you couldn't just keep using MSHTML, though.
When referring to the MS Web Browser Control documentation there is, at the top of the page:
We're no longer updating this content regularly. Check the Microsoft Product Lifecycle for information about how this product, service, technology, or API is supported.
And next to it, a button: "Recommended Version."
Click the button, and it's the MS Edge dev portal. From there, we see, amongst others. a link to Mozilla Developer Network Web Docs, and another to MS's own Progressive Web Apps on Windows. Not so MSHTML edity anymore, but if you want it implemented, then perhaps uservoice?

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

Framework for both: web & standalone application

Dear everyone, I am just curious, is it possible to create standalone GUI application which further can be easily migrated to the web? Or, even better, will be able to work in two modes locally and remotely through web browser. Since the main application logic is already written on C++ I read a little about Qt Quick. As I understood it is somehow possible to mix web application and standalone one, but I haven't found direct example illustrating the case I am interested in. Any ideas?
Depends on what your application does. If it is heavy UI bound and not calculation intense you will not get very far with Qt. There are a few toolkits for Java like GWT which help you to program an AJAX app like you would program a normal desktop GUI - but i don't know any C++ framework doing the same.
For a non heavy UI bound application i would convert the UI to HTML5 and just deploy the webserver infrastructure with your application and a self written Browser based on QT. With this it is trivial to switch between local and remote apps.
For a heavy UI bound application, use GWT.
If you write your back in terms of services, then your stand-alone and web front ends can both use them. That lets you have multiple user interfaces without affecting the processing. Easy to add mobile, too.

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.

Google Earth and Windows application

I have a C++ Windows application continually updating lat, long and altitude.
I would like my application to incorporate Google Earth to visually "track it".
Any advice or pointing in the right direction would be appreciated.
Thanks.
You can embed the Google Earth plugin into your application as an ActiveX control. The API for the control can be found here. You need to instantiate your GEPlugin control and from here you can retrieve all the other COM objects. There is no need to register with Google for the development key. This is not supported by Google as it bypasses the official method of development using Javascript.
Starting point - look at using a web browser as a control/component. For example, Internet Explorer can be used as an ActiveX control. Not easy in plain C++, but supported by MFC - which I'm not very familiar with.
I can't give any more specific pointers than that, unfortunately, except that I tried it once a few years ago (just for fun) and couldn't get it to work. I could get it into a dialog, but when I told it to load a page, it would stay blank.
Still, it is possible - look at all the magazine coverdisks that have "their own web browser".
Sep,
Can you provide a few more details on how to do this with the GE Plugin? I've gotten it working by embedding a browser object in my C# app, but not directly as an ActiveX control. If I can avoid having to create a web site to host javascript, then I'm all for that. Thanks!
Bob