开发者

How to solve 'Attempted to read or write protected memory......' error with programmatic approach for WebBrowser component?

I have a windows application which uses a form containing WebBrowser component. I never found this error message in the navigate method of it, till OS Vista. But it only shows up for OS Windows 7.

Yes, solutions - 1) At post build - call "$(DevEnvDir)....\VC\bin\vcvars32.bat" call "$(DevE开发者_开发技巧nvDir)....\VC\bin\editbin.exe" /NXCOMPAT:NO "$(TargetPath)"

2) editbin.exe /NXCOMPAT:NO YourProgram.exe

works for me, but I need a programmatic approach. If any one can help me about it. Thanks in advance... :).


You can add this to your postbuild events in your project.

http://jtstroup.net/post/Attempted-to-read-or-write-protected-memory-This-is-often-an-indication-that-other-memory-is-corrupt.aspx


You could p/Invoke SetProcessDEPPolicy. Note that this can be overridden by an AlwaysOn system-wide DEP policy.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜