Rahul Soni's blog

Never assume the obvious is true!

Dim browser As SHDocVw.InternetExplorer does something different in Vista

Dim browser As SHDocVw.InternetExplorer does something different in Vista

  • Comments 1

First of all, I wouldn't pretend to know something which I don't. But this is kindda interesting...

I got a comment on one of my previous posts from  Boyd who was seeing a weird error on Vista. He had an application with the following code...

    Sub test()
        Dim br As SHDocVw.InternetExplorer
        br = New SHDocVw.InternetExplorer
        br.Visible = True
        br.Navigate2("www.microsoft.com")
    End Sub

This was working in a weird way on Vista. The issue was pretty simple to reproduce. Just notice the Blank browser instance here which says Connecting.

 image

Now... I am not an IE guy, but after playing around for a few seconds I commented out that br.visible = True and the issue went away. The thing which really perplexed me was that it was mentioned to code this way in quite a few Microsoft articles.

For eg.

http://msdn2.microsoft.com/en-us/library/aa752044.aspx and
http://msdn2.microsoft.com/en-us/library/ms970672.aspx etc.

I checked that same exe on a win 2k3 box and it shows just 1 browser instance. I decided to have a quick chat with one of my colleagues Kiran and she enlightened me with the following article http://msdn2.microsoft.com/en-us/library/Bb250462.aspx and the fact that adding www.microsoft.com to trusted zone will ensure that two IE browser instances won't open up. I tried it on my Vista and it now works!!

I am not sure of the design intricacies of Internet Explorer and the trusted zones etc. But in case you are seeing this issue... you know what to do :-)

Cheers,
Rahul

Quote of the day:
When a man is wrapped up in himself, he makes a pretty small package. - John Ruskin

  • How do i know that page is fully loaded through code.

Page 1 of 1 (1 items)
Leave a Comment
  • Please add 2 and 4 and type the answer here:
  • Post