|
-
Sep 8th, 2010, 12:30 AM
#1
Thread Starter
Hyperactive Member
access violation exception in web browser control?
win7 64bit, VB express 2010.
I'm working on a project. The main form is a MDI parent, it host a control form. on control form, there is a button. when click it, it will start, say 10, threads.
each thread will open a standard alone form (not mdi). on each form, it has a web browser control. when the form opened, it will start a new thread which makes the web browser control load a url, then depends on the links in that url, it will load another url, and loop for some times. then, the thread stops, and the form closes.
for some reasons, I got this weird exception:
AccessViolationException was unhandled by user code. Attempted to read or write protected memory. This is often an indication that other memory is corrupted.
1) the exception happens randomly, and not always happen. when it happens, it is always some code related with the web browser, i.e.
Not (MDIWebBrowser.ReadyState = WebBrowserReadyState.Complete)
or
MDIWebBrowser.Document.Body.InnerText()
2) I put a try catch in, but, it can not catch this exception. If I just close the exception dialog, sometimes, it keeps running without problems. sometimes, it just pauses the webbrowser control.
so, I did some research. it seems many people had the exact same problem. and it seems the best choice is:
http://stackoverflow.com/questions/1...ationexception
I checked all solutions suggested, even manually change the DEP, by using
"bcdedit.exe /set {current} nx AlwaysOff"
but, the exception still pops up.
anyone had this problem before? any suggestions?
thanks 
-
Sep 8th, 2010, 12:38 AM
#2
Thread Starter
Hyperactive Member
Re: access violation exception in web browser control?
according some possible solution:
http://jtstroup.net/post/Attempted-t...s-corrupt.aspx
==============
1) Right click on project in Visual Studio
2) Properties
3) Build Events
4) Edit Post Build ...
REM Mark project as DEP Noncompliant
call "$(DevEnvDir)..\..\VC\bin\vcvars32.bat"
call "$(DevEnvDir)..\..\VC\bin\editbin.exe" /NXCOMPAT:NO "$(TargetPath)"
Another way to do this is to open up the Visual Studio command prompt, browse to your exe location and type:
editbin.exe /NXCOMPAT:NO YourProgram.exe
====================
Obviously, it is for C#. I'm using vb. how can I edit "Post Build"? where can I find the editbin.exe? have to install something?
thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|