Page Not found error when i open a web page from windows application using SHDocVw.InternetExplorerClass

Hi,

I have a windows form. In that i am opening a web page using below code.

Dim o As Object = Nothing

Dim ie As New SHDocVw.InternetExplorerClass

Dim wb As IWebBrowserApp = CType(ie, IWebBrowserApp)

wb.Visible = True

wb.Navigate(url, "PDSReports", o, o, o)

it opens a new page correctly with the url i specified when my OS is XP.

when i use the same code in windows server 2003, i get an error saying page not found.

if i copy the same url and paste it in a new browser window then it works fine.

when i use above code in windows 2003 server, do i need to specify any special configuration settings in app.config file,

Any help is appreciated.

madhu.




Answer this question

Page Not found error when i open a web page from windows application using SHDocVw.InternetExplorerClass

  • David Bosley

    i had made the following changes :

    member variable code :

    Protected Friend WithEvents wb As New WebBrowser

    Button event code is as follows:

    Me.Controls.Add(wb)

    wb.Visible = True

    wb.navigate("www.microsoft.com")

    When i try with the above changes i am getting the following error;

    System.InvalidCastException: Specified cast is not valid. at the line Me.controls.add(wb)

    Can u suggest me if i need to do anything else



  • leunam

     

    I'd try this as a member variable:

    Protected friend withevents wb as new WebBrowser

    Then in your form load or gobutton click events:

    Me.controls.add(wb)
    wb.navigate("www.microsoft.com")

    That should do it and I expect it will work on all nodes.



  • Page Not found error when i open a web page from windows application using SHDocVw.InternetExplorerClass