I have a program that uses the built in webbrowser control. At some point during the usage of this, I\'m not sure at what point, but it appears to be random, I get the foll
This seems to be a Vista Issue, what happend to me was that my C# webBrowser1 opend a web page that runned a java applet that opend a external IE webpage that runs a ActiveX app/script.
When the ActiveX script tryes to update back in to the memory of the C# app the DEP "Data Execution Prevention" in Vista flags this operation as hostile/virus and ends the program with the System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt."
My fix for this was to turn of DEP in Vista with this line in cmd
"bcdedit.exe /set {current} nx AlwaysOff"
and reboot the machine.
XP also run DEP so in certain cases i guess this cold happen here too. To test if its a DEP issue do this.
Right click on "My Computer" Select "Properties" and "Advanced" Under "Startup and Recovery, click Settings Now click on "Edit" The notepad has just begun. Simply replace the line: Code: noexecute optionn by AlwaysOff Restart your PC to complete the transaction.
If you want to reactivate the DEP be sufficient to conduct the reverse, like this:
Replace by Quote: AlwaysOff noexecute = noexecute = optin
I ended up just opening up the webpage in the browser. That way I don't even have to worry about this. It's still strange that it throws this error though.