For years the ActiveX WebBrowser control which is based on Internet Explorer (trident) has been used by a lot of applications as an embedded control.
By using Trident as an embedded browser control, it was possible to extend your application functionality with great success. Sadly Microsoft has declared the trident based control as legacy and is no longer continuing development for it.
Another control has come in its place, based on Chromium. It is called WebView2 and shares code with Microsoft Edge.
Microsoft provides bindings for a variety of languages and even added a com interface, but not all programming languages can directly consume that particular interface.
Microsoft declared that interface as being solely for C++ and refers to it as the Win32 interface whereas the other programming languages it is designed for are .net variants.
This is why Antwise Solutions developed an ActiveX wrapper for the WebView2 control so that it is easy to use from any language that is able to use ActiveX controls. Our ActiveX wrapper supplies a dual interface and has been tested with a variety of development platforms including: Visual Basic, Visual FoxPro, DataFlex and Microsoft Excel.
This control is called: “AntView”.
With the old Microsoft WebBrowser control you could access and manipulate the html document DOM interface via an automation interface commonly referred to as mshtml. This was very powerful.
The WebView2 control does not offer a direct way to interact with the DOM interface, however it does offer a javascript bridge through which you can do most of what you formerly could do via mshtml.
We do expose the javascript interface via ExecuteScript, but as it is an asynchronous interface and everything it returns is done via JSON, it sometimes is a bit confusing to use. In order to simplify interacting with the html document hosted in your control, we added the AntViewDocument automation class that lets you do some of the more standard things:
- Request the html of the page currently rendered.
- Read the value of any html element by name or id.
- Write the value of any html element by name or id.
- Submit a form by id
- Execute an anonymous function where you can pass your parameters from native code
- Decode a JSON object string
We expect that this will be extended upon over time, so that the amount of embedded javascript you will need to write can be kept to a minimum.
However if you want to use rich javascript based interfaces then that’s supported as well of course. The installer comes with a variety of examples to show you how-to include WebView2 into your applications and shows you how-to interact with the component.
We hope you enjoy our ActiveX control and if you have any questions then do drop us an email.