如何使用 WebBrowser 组件的编程方法解决“尝试读取或写入受保护的内存......"错误? [英] How to solve 'Attempted to read or write protected memory......' error with programmatic approach for WebBrowser component?
问题描述
我有一个 Windows 应用程序,它使用一个包含 WebBrowser 组件的表单.在 OS Vista 之前,我从未在它的导航方法中发现此错误消息.但它只显示在 Windows 7 操作系统上.
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.
是的,解决方案 -1)在后期构建 -调用$(DevEnvDir)....\VC\bin\vcvars32.bat"调用 "$(DevEnvDir)....\VC\bin\editbin.exe"/NXCOMPAT:NO "$(TargetPath)"
Yes, solutions - 1) At post build - call "$(DevEnvDir)....\VC\bin\vcvars32.bat" call "$(DevEnvDir)....\VC\bin\editbin.exe" /NXCOMPAT:NO "$(TargetPath)"
2) editbin.exe/NXCOMPAT:NO YourProgram.exe
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.
这篇关于如何使用 WebBrowser 组件的编程方法解决“尝试读取或写入受保护的内存......"错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!