System.AccessViolationException was unhandled

K

kristenharding

MS Visual Studio 2008 Version 3.5 and my OS is Vista.

I have a web browser control on a form and when the form loads I am
getting the error "Attempted to read or write protected memory. This
is often an indication that other memory is corrupt." The website I am
trying to view is a program and it has an IP Address as part of the
web address (http://xxx.xxx.xxx.xx/gpmsweb/idex.html). If I change the
website to "http://www.yahoo.com" the form will run fine and load the
website in the webbrowser. When I open a regular IE window on my
computer I am able to load the website that will not load in the
webbrowser control on the form. And this was able to run on a
different computer, although I am not sure of what they are running
for an OS.

Here is the detail of the message

Message="Attempted to read or write protected memory. This is often an
indication that other memory is corrupt."
Source="System.Windows.Forms"
StackTrace:
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at
System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop
(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner
(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32
reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at PM_Viewer.Program.Main() in C:\Users\klb\Desktop\CUC_Viewers
\Program.cs:line 17
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[]
args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence
assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
 
P

Peter Duniho

kristenharding said:
MS Visual Studio 2008 Version 3.5 and my OS is Vista.

I have a web browser control on a form and when the form loads I am
getting the error "Attempted to read or write protected memory. This
is often an indication that other memory is corrupt." The website I am
trying to view is a program and it has an IP Address as part of the
web address (http://xxx.xxx.xxx.xx/gpmsweb/idex.html). If I change the
website to "http://www.yahoo.com" the form will run fine and load the
website in the webbrowser. When I open a regular IE window on my
computer I am able to load the website that will not load in the
webbrowser control on the form. And this was able to run on a
different computer, although I am not sure of what they are running
for an OS.

Here is the detail of the message

Message="Attempted to read or write protected memory. This is often an
indication that other memory is corrupt."

Too little information, especially given that the web site appears to
load fine in IE (though, that easily could just be because IE is
catching the error and suppressing it from the user's view).

Your description is hard to understand, as you write "the website...is a
program". That doesn't really make much sense. A website isn't a program.

As for the error itself, the message is self-explanatory, as far as it
goes. Of course, it doesn't explain _why_ the code is trying to access
an invalid memory address (other than the very vague explanation that
memory was corrupted somehow), but then it's a very vague error.
There's not much the operating system can do to identify where the
invalid address came from. Just that it's invalid.

Without more information -- and really, you need to post a
concise-but-complete code example for anyone to really be able to say
anything definitive -- there's not much that can be said, except that
you need to look for someone passing invalid data somewhere.

Given the stack trace -- i.e. that the problem occurs while trying to
dispatch a window message -- it seems likely that someone either posted
invalid data for the message or (more likely, I think) used an invalid
window handle. Of course, it's entirely possible that the _real_
problem is somewhere well in advance of the exception, and the exception
is only a symptom of that.

Again, impossible to say without a proper code example.

Pete
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top