04-17-2024 03:27 AM
HI,
in my labwinodws/CVI 2020 project I use the activeX Microsoft WebBrowser. THE problem I'm having is that it no longer displays pages correctly and always shows errors for js scripts.
I believe this is due to the fact that activeX is based on internet explorer.
Is there a working alternative to this activex? Maybe based on Edge?
Hello,
Mattia
04-18-2024 04:17 AM - edited 04-18-2024 04:18 AM
Not as ActiveX Control, you will have to move to use the WebView2 .Net Control.
04-18-2024 04:23 AM
Do you have any suggestions on how to integrate it?
Thanks,
Mattia
04-18-2024 04:59 AM - edited 04-18-2024 05:15 AM
@Mattia.G wrote:
Do you have any suggestions on how to integrate it?
Thanks,
Mattia
I'm afraid you would have to create an interface library for WebView2, similar to what is contained in the <CVI>\samples\dotnet\mscorlib2.[c;h;fp] for the classes and methods needed. Additional difficulties will be to create the bridge to integrate the .Net Control with this interface.
04-18-2024 06:50 AM - edited 04-18-2024 07:21 AM
I'm afraid, I mislead you. There is no .Net UI Container in LabWindows/CVI like in LabVIEW. So I'm afraid you could not integrate the WebView2 .Net Control easily into a LabWindows/CVI front panel. I'm sure there are possibilities that would likely involve getting a native Windows window handle assigned as a child window into a LabWindows/CVI front panel, but that is likely a major hassle to get working.
After a bit of researching, you would most likely have to call CreateCoreWebView2Environment() from the WebView shared library. This interface is COM based and exposes the COM interfaces as also use in the dotnet examples for all the various system classes.