From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

MS Internet Explorer Navigation method using the flag navOpenNewForegroundTab

Solved!
Go to solution

I've been struggling to use the activeX browser methods and properties as the scripting syntax translates to LabVIEW.  For example, the diagram image I am attaching shows the Navigate flags I have tried and failed to produce the desired effect.  Anybody have any ideas why the method is not loading a browser with 5 tabs?  Am I not using the method function properly?  I also tried to use the OpenNewWindow flag and this seemed to do nothing as well.  The only effect I have is the URL loading into the same tab each time, including the original tab opened in the existing web browser session.

 

I found my information here:

https://msdn.microsoft.com/en-us/library/aa768360(v=vs.85).aspx

 

navOpenNewForegroundTab.jpg

 

0 Kudos
Message 1 of 9
(4,749 Views)

This seems to work fine here (Win 7, IE 10):

 

Example_VI_BD.png

 

It opens a new window with 3 tabs (it starts with an empty one). Maybe it's because it's set up to open links in new tabs.


___________________
Try to take over the world!
0 Kudos
Message 2 of 9
(4,711 Views)

I am using Win 7, IE 10, the same ActiveX class and same method function.  But it only loads new URLs into the very same starting tab.  The flag values dont seem to have any affect.  It acts as if I have not applied any flags at all.  New forground tab, background tab, new tab, and the OpenNewWindow values dont seem to do anything.

 

I can get the same result by not tying in any flag values.  I am wondering if there isnt an OS security setting that is preventing me from using the flag arguments.  I couldnt find anything in IE 10 options that would impact this.  And there is nothing within the LabVIEW settings that is jumping out at me here.

 

I'll see if I can research the flag issue.  It is important to get this working, otherwise any variant data I pass into these functions may not work correctly.

 

Thanks,

Mike B.

 

 

0 Kudos
Message 3 of 9
(4,686 Views)

Like I said, my IE is configured to open links in a new tab (settings>>tabs>>at the bottom) and I'm guessing that's what does this. Other than that I can't really say anything, as I haven't used IE in years.


___________________
Try to take over the world!
0 Kudos
Message 4 of 9
(4,670 Views)

If I use the snippet from tst with 0x10000 on my system nothing happens at all. If I use 0x10001 then a new IE window opens with 3 tabs, an empty one and one other for each link, no matter what setting I have in the IE Options for how to open external links.

 

LabVIEW 2014, Windows 7 pro, IE 10

Rolf Kalbermatter
My Blog
0 Kudos
Message 5 of 9
(4,664 Views)

Hmmm  I have been working on this again today and cannot find a reason why flags have no effect on the Navigate method.  When I began playing with ActiveX on this system, I had to manually register the MSCOMCT2.OCX and MSCOMCTL.OCX files to get the LabVIEW functions to work properly.  I am wondering if there are other related OCX registrations that need to be active.

 

The trouble with the LabVIEW method is I don't have an option to retrieve the "return value" from the Navigate method when executed.  I don't know if I have a valid parameter or if the command was completed.  I do not get an ActiveX error propagating from the method function when executed.

 

I am using LabVIEW 2011.  I don't know if that has anything to do with my problem duplicating your success in using the method.

 

Mike B.

0 Kudos
Message 6 of 9
(4,641 Views)

Are you sure you're using the same ActiveX method? I noticed that in your image you're using the "Navigate" method, whereas the image that tst posted uses the "Navigate2" method. Also, are you embedding your Internet Explorer window inside the LabVIEW front panel? If so, I'm not sure tabs are supported.

0 Kudos
Message 7 of 9
(4,631 Views)
Solution
Accepted by Mike_B.

The problem was in the data type for the FLAG value.  I was passing an I64 represented hexidecimal datatype into the variant conversion function.  When I selected I32 for data representation, the method began to work properly.

 

Mike B.

0 Kudos
Message 8 of 9
(4,587 Views)

I use the same for opening XML-Reports (TestStand).

 

If you don't want to have the empty tab first, just open at first one file and after that use the For-Loop to open further files in additional tabs.

 

In my case only the flag x10001 works (I32).

0 Kudos
Message 9 of 9
(4,372 Views)