Page 1 of 1

.Net Assembly replacement for IE HTML activex

Posted: Wed Dec 08, 2021 3:41 am
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

Re: .Net Assembly replacement for IE HTML activex

Posted: Wed Dec 08, 2021 4:41 am
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/

Re: .Net Assembly replacement for IE HTML activex

Posted: Wed Dec 08, 2021 5:25 am
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!

Re: .Net Assembly replacement for IE HTML activex

Posted: Tue Dec 14, 2021 2:25 am
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/

Re: .Net Assembly replacement for IE HTML activex

Posted: Thu Jan 13, 2022 7:52 am
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

Re: .Net Assembly replacement for IE HTML activex

Posted: Tue Jan 18, 2022 4:10 am
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.

Re: .Net Assembly replacement for IE HTML activex

Posted: Tue Jan 18, 2022 4:15 am
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

Re: .Net Assembly replacement for IE HTML activex

Posted: Tue Jan 18, 2022 4:38 am
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

Re: .Net Assembly replacement for IE HTML activex

Posted: Tue Jan 18, 2022 12:07 pm
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/")

Re: .Net Assembly replacement for IE HTML activex

Posted: Tue Jan 18, 2022 1:19 pm
by atostaine
That explains the script errors. Maybe they will at least keep updating this.

Re: .Net Assembly replacement for IE HTML activex

Posted: Thu Mar 31, 2022 11:43 pm
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 1061428 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 1061428 times
May I know if there are additional setup that I may have missed for this error to occur? Thanks.

Re: .Net Assembly replacement for IE HTML activex

Posted: Fri Apr 01, 2022 12:30 am
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 1061422 times
use netWebView as name
dotnet03.jpg
dotnet03.jpg (9.43 KiB) Viewed 1061422 times
and then select the .net componet to generate the lansa code,
dotnet02.jpg
dotnet02.jpg (118.42 KiB) Viewed 1061422 times
save and try again.

Re: .Net Assembly replacement for IE HTML activex

Posted: Fri Apr 01, 2022 10:54 pm
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 1061337 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.

Re: .Net Assembly replacement for IE HTML activex

Posted: Sat Apr 02, 2022 1:56 am
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.

Re: .Net Assembly replacement for IE HTML activex

Posted: Mon Apr 04, 2022 11:05 pm
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 1061246 times
Steps Taken:
Successfully installed AntView.
InstalledAntView.JPG
InstalledAntView.JPG (51.84 KiB) Viewed 1061246 times
Registered AntView
RegisteredAntViewOCX.png
RegisteredAntViewOCX.png (75.34 KiB) Viewed 1061246 times
Copied the WebView2Loader DLL to the Partition Execute Folder.

Re: .Net Assembly replacement for IE HTML activex

Posted: Mon Apr 04, 2022 11:25 pm
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 ?

Re: .Net Assembly replacement for IE HTML activex

Posted: Mon May 02, 2022 4:44 pm
by edz.rama
Hi All,
I created a guide for installing AntView as well as sample components to show how to use it.

Re: .Net Assembly replacement for IE HTML activex

Posted: Mon Jul 11, 2022 3:56 pm
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