views:

245

answers:

3

I have a simple winforms app just one window with one WebBrowser control inside. On vista this fails to show the date but works OK XP ? The website runs activeX to show the date.

namespace WindowsFormsBrowserTest
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            this.webBrowser1.Navigate("http://www.pcpitstop.com/testax.asp");
        }
    }
}

http://www.pcpitstop.com/testax.asp

Any clues would be really spreciated, should be simple but I have no idea.

Any security experts out there ?

+2  A: 

Can you view the website properly in Internet Explorer on Vista when it fails? I know when I visit that website I get asked to install an ActiveX control. The WebBrowser control won't handle the installation of the ActiveX control for you.

Matthew Iselin
Yes in my browser (IE8) on the vista machine, I am asked to install the active X once, then all is working fine.Then i run the app again it asks me to install the active X , then the date does not show.If I take the winforms app to a XP machine after the active x is installed then the date works fine too.
Kaya
So whats the difference between running in the browser and running in the winforms browser ?
Kaya
Basically, Internet Explorer is a full program built around the WebBrowser control. So when you insert the WebBrowser control into your WinForms application, you're inserting the basic core renderer for IE.However, I'm not entirely sure how to ensure that your application can install the ActiveX control on-demand.
Matthew Iselin
A: 

In Internet Explorer on your Vista machine, go to "Internet options", "Security" tab page. You will see an option "Enable protected mode". Turn it off... :-)

(This option doesn't exist on XP and other Windows versions.)

Workshop Alex
OK I tried disabling the protected mode option re booted but still no joy. Aaahhggg.Cheers for the help though
Kaya
A: 

I have eventually sorted this issue out. One web page caused exceptions.

The application was hosting a web page running an activeX control.

Turned off Data Execution Prevention "DEP" for the application with a post build step.

All working fine now.

Kaya