.Net Assembly replacement for IE HTML activex

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
dhnaigles
Posts: 56
Joined: Wed Feb 03, 2016 1:34 am
Location: Marlborough, MA, USA

.Net Assembly replacement for IE HTML activex

Post by dhnaigles »

Since Microsoft is planning on doing away with IE and, therefore, activex, does anyone have a suggestion for replacing our HTML Web ActiveX control in our VL Win applications? I'm looking for best in class as we use this functionality in many different VLF-Win command handlers. Thanks in advance.
David
User avatar
Dino
Posts: 472
Joined: Fri Jul 19, 2019 7:49 am
Location: Robbinsville, NC
Contact:

Re: .Net Assembly replacement for IE HTML activex

Post by Dino »

Hi!

Looks like Microsoft is pushing this direction instead, but I haven't tried it yet:

https://docs.microsoft.com/en-us/micros ... /webview2/
dhnaigles
Posts: 56
Joined: Wed Feb 03, 2016 1:34 am
Location: Marlborough, MA, USA

Re: .Net Assembly replacement for IE HTML activex

Post by dhnaigles »

I read it, and downloaded the cab file, but for the life of me, I can't figure out how to install it in all my users desktops. It looks like the solution, but without some more simplistic instructions, I guess I'm just an old fart!
LANSAfolks
Posts: 49
Joined: Thu Oct 10, 2019 9:32 am

Re: .Net Assembly replacement for IE HTML activex

Post by LANSAfolks »

Hi David,

You can download the install file from here: https://www.nuget.org/packages/Microsoft.Web.WebView2
Use Package Manager to install this: https://docs.microsoft.com/en-us/window ... er/winget/
Attachments
PackageManager
PackageManager
PackageManager_WinGet.png (51.97 KiB) Viewed 1072430 times
dhnaigles
Posts: 56
Joined: Wed Feb 03, 2016 1:34 am
Location: Marlborough, MA, USA

Re: .Net Assembly replacement for IE HTML activex

Post by dhnaigles »

SOLUTION!!!!!
I found a solution. Rather than using WebView2, you can use System.Windows.Forms.dll. It has a class called WebBrowser and it works very well. You will probably have it on your desktop as it is usually in developer's packages. I found mine in C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.2\ . To distribute it, just copy the dll and the xml files to your partition execute directory at deployment. Here is a sample of the easy code to navigate:

Define_Com Class(#netWebView.System.Windows.Forms.WebBrowser) Name(#WebBrowser) Parent(#COM_OWNER) DisplayPosition(1) TabPosition(4) Left(0) Top(69) Height(456) Width(746)

Mthroutine Name(URLNavigate)
Define_Map For(*INPUT) Class(#prim_alph) Name(#pathName)
#WebBrowser.Navigate#1 urlString(#pathName)
Endroutine
atostaine
Posts: 696
Joined: Wed Jan 20, 2016 7:38 am

Re: .Net Assembly replacement for IE HTML activex

Post by atostaine »

David: That works great! I tested my two go to URL's, google.com and espn.com. espn.com had many script errors. Not that I'd use it for espn but it makes me wonder the version of the "browser" that it's using.
Art Tostaine
dhnaigles
Posts: 56
Joined: Wed Feb 03, 2016 1:34 am
Location: Marlborough, MA, USA

Re: .Net Assembly replacement for IE HTML activex

Post by dhnaigles »

Art
That is certainly a possibility. I have been using Edge or a Chromium based browser for all my work. Try possibly changing the default browser and see what happens
atostaine
Posts: 696
Joined: Wed Jan 20, 2016 7:38 am

Re: .Net Assembly replacement for IE HTML activex

Post by atostaine »

I use Chrome (my current default) or Chromium Edge as well. I'm not worried about the script errors. I need to test it on the internal sites we use. Thanks again
Art Tostaine
User avatar
Dino
Posts: 472
Joined: Fri Jul 19, 2019 7:49 am
Location: Robbinsville, NC
Contact:

Re: .Net Assembly replacement for IE HTML activex

Post by Dino »

well done!
I tried it in my computer and it says IE 11.... so still not using Edge, but at least not using activex it is dot net now:

Code: Select all

#COM_OWNER.URLNavigate pathName("https://www.whatsmybrowser.org/")
Attachments
whatbrowseriamusing.jpg
whatbrowseriamusing.jpg (98.5 KiB) Viewed 1063903 times
atostaine
Posts: 696
Joined: Wed Jan 20, 2016 7:38 am

Re: .Net Assembly replacement for IE HTML activex

Post by atostaine »

That explains the script errors. Maybe they will at least keep updating this.
Art Tostaine
rigor
Posts: 3
Joined: Tue Oct 19, 2021 1:42 am

Re: .Net Assembly replacement for IE HTML activex

Post by rigor »

Hi David,

I'm also investigating an issue related to this. I've tried the instructions you've mentioned.
Please see screenshot below.
Is this correct?
DLL.JPG
DLL.JPG (238.67 KiB) Viewed 1061432 times
But when I tried to copy the logic for the define com on Lansa IDE, I encountered this error.
error.JPG
error.JPG (24.06 KiB) Viewed 1061432 times
May I know if there are additional setup that I may have missed for this error to occur? Thanks.
User avatar
Dino
Posts: 472
Joined: Fri Jul 19, 2019 7:49 am
Location: Robbinsville, NC
Contact:

Re: .Net Assembly replacement for IE HTML activex

Post by Dino »

Hi Rigor,

Did you registered the .net component in the LANSA Repository?
File, New, .Net Component,
dotnet01.jpg
dotnet01.jpg (18.12 KiB) Viewed 1061426 times
use netWebView as name
dotnet03.jpg
dotnet03.jpg (9.43 KiB) Viewed 1061426 times
and then select the .net componet to generate the lansa code,
dotnet02.jpg
dotnet02.jpg (118.42 KiB) Viewed 1061426 times
save and try again.
rigor
Posts: 3
Joined: Tue Oct 19, 2021 1:42 am

Re: .Net Assembly replacement for IE HTML activex

Post by rigor »

Hi Dino,

Thank you for your response.

It resolve my issue with the Component Class not found and I was able to make it work.
IE11.JPG
IE11.JPG (116.35 KiB) Viewed 1061341 times

Additional question, is there a way to change IE11 and use Google Chrome instead as the Web Browser for the Component Class?
I've already disabled Internet Explorer 11 on my VM and made the Google Chrome as my default browser but the Command Handler still shows IE11 as my browser.

Thanks.
PatrickF
Posts: 30
Joined: Thu Nov 26, 2015 1:31 pm

Re: .Net Assembly replacement for IE HTML activex

Post by PatrickF »

Looking at Microsoft's documentation on the control at https://docs.microsoft.com/en-us/dotnet ... esktop-6.0 I see this : "The WebBrowser control is a managed wrapper for the ActiveX WebBrowser control, and uses whichever version of the control is installed on the user's computer."
I wonder whether the Microsoft Control will still have the dependency on the Active-X and this will still be tied to IE11, despite what the Windows default browser is set to.
rigor
Posts: 3
Joined: Tue Oct 19, 2021 1:42 am

Re: .Net Assembly replacement for IE HTML activex

Post by rigor »

I've tried to work on an alternative using ANTVIEW which also uses MS WebView2(https://antview.dev/installation/).

I was able to do the installation steps but encountered this error on VL IDE. I've done the same steps on creating a .Net Component for System.Windows.Form before. May I know if you encountered similar issue before? And if possible, how to resolve the issue?
AntViewError.JPG
AntViewError.JPG (49.44 KiB) Viewed 1061250 times
Steps Taken:
Successfully installed AntView.
InstalledAntView.JPG
InstalledAntView.JPG (51.84 KiB) Viewed 1061250 times
Registered AntView
RegisteredAntViewOCX.png
RegisteredAntViewOCX.png (75.34 KiB) Viewed 1061250 times
Copied the WebView2Loader DLL to the Partition Execute Folder.
PatrickF
Posts: 30
Joined: Thu Nov 26, 2015 1:31 pm

Re: .Net Assembly replacement for IE HTML activex

Post by PatrickF »

Based on the AntVIew documentation, it is shipping an OCX file, which is an ActiveX control.
Can you retry using New->ActiveX rather than attempting to load an ActiveX as a .Net Component ?
edz.rama
Posts: 4
Joined: Fri Mar 16, 2018 11:31 am

Re: .Net Assembly replacement for IE HTML activex

Post by edz.rama »

Hi All,
I created a guide for installing AntView as well as sample components to show how to use it.
Attachments
AntView guide and samples.rar
(2.77 MiB) Downloaded 9587 times
gillettd
Posts: 19
Joined: Tue May 24, 2016 2:13 pm

Re: .Net Assembly replacement for IE HTML activex

Post by gillettd »

Hi,

Just trying the product (ANTVIEW) and it's crashing when i try to navigate to a different url??? It loads correctly only once .

I can nullify the component as a workaround but i think it should work ok for simple navigations

Anybody came across the same issue?

Cheers,

Dominique
Post Reply