473,386 Members | 1,674 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

.NET 2.0 Read or Write Protected Memory Error

I understand that this has come up quite a bit in the forums, and I've looked over a lot of questions and possible solutions and haven't found one that has worked for me yet. I was hoping someone else might have an idea. Here's the full error message: (I underlined what I thought was the most relevant)

"System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at System.Windows.Forms.SafeNativeMethods.SetWindowPo s(HandleRef hWnd, HandleRef hWndInsertAfter, Int32 x, Int32 y, Int32 cx, Int32 cy, Int32 flags)
at System.Windows.Forms.Control.BringToFront()

at StormDuty.frmMain.frmMain_Load(Object sender, EventArgs e)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Mes sage& m)
at System.Windows.Forms.ContainerControl.WndProc(Mess age& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.O nMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.W ndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)"

The code that this appears to be referring to is this:

Expand|Select|Wrap|Line Numbers
  1. this.BringToFront();
'this' is referring to a windows form called frmMain.

This happens on only one person's machine. It works fine on my machine and 4 others, which is why it's making it so hard to debug.

About my program, it's a C# .NET 2.0 project being developed in Visual Studio 2005. It uses One-Click deployment and connects to an Access database. In another forum, someone asked what Interops were being used. I'm using an interop with Outlook specifically and one with Office in general. I'm also using Crystal Reports.

I've tried reinstalling the .NET frameworks(1.1 and 2.0) on the person's computer several times with no effect.

Any help would be greatly appreciated and if you need any more information, feel free to ask.

Thank you,
Steve
Oct 18 '07 #1
4 6070
Yeah, i too am having the same problem. We get this error randomly on certain machines, and it is usually when we are making a COM API call. Not on a .NET call.

We use a COM API for managing GIS map data. All i know is that this exception in new to the 2.0 and it seems that the framework is trying to decide when it is getting into a situation with COM interop (unmanaged code) that may be dangerous. So depends on the computer, memory available, etc...

I have not cracked it yet, but it is debilitating some of our apps and clients. If you find anything our PLEASE pass it on.

Thanks,
Pete
Oct 18 '07 #2
I've been working on this problem off and on for a while now and we've resorted to completely reimaging the user's computer who gets this error. The error still occurs. Does anyone know anything about this? I'm really at a loss.

Thanks,
Steve
Jan 3 '08 #3
Frinavale
9,735 Expert Mod 8TB
I've been working on this problem off and on for a while now and we've resorted to completely reimaging the user's computer who gets this error. The error still occurs. Does anyone know anything about this? I'm really at a loss.

Thanks,
Steve
I replied to your post but realized that it's probably not going to be any help...it's really my own question and debugging progress on the same sort of problem.

If you want to check it out...feel free. You can find it here.

-Frinny
Jan 3 '08 #4
So I finally came up with a solution for this problem. It was the user's mouse driver. I don't know how, but somehow it was interfering with my application. That was surprising considering ClickOnce deployment is supposed to be isolated and self-sufficient. Anyway, hopefully this helps someone.
Jan 11 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: bdinmstig | last post by:
I refined my attempt a little further, and the following code does seem to work, however it has 2 major problems: 1. Very limited support for XPath features Basic paths are supported for...
9
by: hiralparikh | last post by:
Hi, I am using .NET 2.0 and trying to use a function from a native DLL file. Here is the syntax that I am using: definition: public static extern String getPwd(String strServerName, String...
3
by: OUSoonerTaz | last post by:
We are randomly getting this error message on our development and staging machines: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.; at...
4
by: Seok Bee | last post by:
Dear Experts, I have created a script to extract the Event Logs from the system into an excel sheet. The logs are separated into 2 worksheets (Application Log and System Log). After this excel...
2
by: Ilkka | last post by:
I have created an C++ application with Windows Forms, ADO and SQL server 2005. Now I need to change something and started debugging the code. Then suddenly I receive an error. "An unhandled...
2
by: Pieter | last post by:
Hi, Since 10 days (the first time was the 10th of november) I have some weird exception happening in an application here: All (except 1 of the total of 5) users had this error now 1 of 2 times...
2
by: adypoly | last post by:
Hi guys... I am having a typical problem in using one of the native dll in C# I'll explain what am trying to do, I've a dll written in C language which i am trying to include in my C# project,...
6
by: Sugandh Jain | last post by:
Hi, I am getting the error message Attempted to read or write protected memory. This is often an indication that other memory is corrupt. It was not coming until yet, for around 2 months. Now,...
3
by: sriram347 | last post by:
Hi I am a newbie to ASP.NET. I developed a web page (project type is web application) and I keep getting this error. B]Error message : "System.AccessViolation Exception attempted to read or...
3
by: maneshborase | last post by:
Hi friends, I am facing one serious problem in my application. I am trying to open dicom image file (.dcm) has size around 400 MB. But I am getting and unhandy exceptions, Some time, ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.