From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Embed IE window inside CVI

Solved!
Go to solution

I'm attempting to embed a modern version of IE inside a CVI application, and not have CVI just launch an IE window.

 

I've looked at the activex\WebBrowser demo project and it does exactly what I want, it's just that the version of IE that loads embedded is IE7. Basically no javascript loads and runs correctly in IE7, which means it's essentially worthless to me. forums.ni.com can't even load correctly.

 

I took a peek at activex\iedemo project, and it loads and runs IE11 on my machine which is exactly what I want, it's just not embedded.

 

Has anyone successfully done this before, and can you provide some details? I'm using CVI2015.

Kevin B.
0 Kudos
Message 1 of 3
(2,516 Views)

Hello, Kevin,

Sounds like this could be on the Microsoft/ActiveX side and not the CVI side. See these forum posts. It seems you may be able to tweak some settings in IE.

 

internet explorer 11
https://stackoverflow.com/questions/26151999/ie11-prevents-activex-from-running

 

windows
https://stackoverflow.com/questions/6914664/iwebbrowser2-object-uses-ie7-version-instead-of-the-ie-v...

 

Message 2 of 3
(2,481 Views)
Solution
Accepted by topic author Kevin_B.

Thank you!

 

Your first link actually doesn't have anything to do with the issue. That's referencing browser plugins and isn't related at all.

 

Your second link contains the solution. Apparently when using the WebBrowser ActiveX control, you must tell Windows what version of IE to "emulate" otherwise it defaults to IE7 (you know... because that seems smart).

 

In regedit I opened up

Computer\HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION

And added a DWORD value with the exact name of my application and a value of '2af9' (11001) and upon restarting my application (didn't need to reboot) my user agent is now reported as IE11 and I have no more issues. If I needed to use a different version of IE the list of DWORD values is here.

 

I actually had to add entries for my_application.exe and my_application_dbg.exe so that it worked in both debug and release modes.

Kevin B.
Message 3 of 3
(2,474 Views)