473,799 Members | 2,665 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

.NET 2.0 Read or Write Protected Memory Error

17 New Member
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.AccessV iolationExcepti on: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at System.Windows. Forms.SafeNativ eMethods.SetWin dowPos(HandleRe f hWnd, HandleRef hWndInsertAfter , Int32 x, Int32 y, Int32 cx, Int32 cy, Int32 flags)
at System.Windows. Forms.Control.B ringToFront()

at StormDuty.frmMa in.frmMain_Load (Object sender, EventArgs e)
at System.Windows. Forms.Form.OnLo ad(EventArgs e)
at System.Windows. Forms.Form.OnCr eateControl()
at System.Windows. Forms.Control.C reateControl(Bo olean fIgnoreVisible)
at System.Windows. Forms.Control.C reateControl()
at System.Windows. Forms.Control.W mShowWindow(Mes sage& m)
at System.Windows. Forms.Control.W ndProc(Message& m)
at System.Windows. Forms.Scrollabl eControl.WndPro c(Message& m)
at System.Windows. Forms.Container Control.WndProc (Message& m)
at System.Windows. Forms.Form.WmSh owWindow(Messag e& m)
at System.Windows. Forms.Form.WndP roc(Message& m)
at System.Windows. Forms.Control.C ontrolNativeWin dow.OnMessage(M essage& m)
at System.Windows. Forms.Control.C ontrolNativeWin dow.WndProc(Mes sage& m)
at System.Windows. Forms.NativeWin dow.Callback(In tPtr 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 6092
pmcalenney
8 New Member
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
SteveHasel
17 New Member
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 Recognized Expert Moderator Expert
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
SteveHasel
17 New Member
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
6826
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 elements, attributes, ".", and "..", plus also the "" predicate format is supported - however, only one predicate per path step is supported, and expr must be a relative path. 2. Poor performance
9
21357
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 strUserId);
3
7125
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 System.Data.Common.UnsafeNativeMethods.OraMTSJoinTxn(OciEnlistContext pCtxt, IDtcTransaction pTrans) at System.Data.OracleClient.TracedNativeMethods.OraMTSJoinTxn(OciEnlistContext pCtxt, IDtcTransaction pTrans)
4
7288
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 file being created, it will be sent out via email to the list of recipients. I run the script on my notebook (also developed on th same machine) it works fine. However, when I copy all the programs into the server which running on Windows 2000...
2
21978
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 exception of type 'System.AccessViolationException' occurred in mscorlib.dll Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt." The progran ends on a windows form designer...
2
4189
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 during the last 10 days. It happens mostly during startup or closing of the application, but sometimes just in the middle of nowhere. It doesn't point to anyting special. I don't get a clue... It's a Windows Forms VB.NET 2005 application. I roll...
2
20746
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, the solutions builds fine but once i try to run the program it gives an exception as "Attempted to read or write protected memory. This is often an indication that other memory is corrupt" I am passing two integer pointer variables as the...
6
49914
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, may be the records have increased and so i am getting this. anyone has any idea why and when do we get this. Its a windows based application with c# 2.0 and .Net Framework 2.0.
3
6949
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 write protected memory. this is often an indication that other memory is corrupt.... " These are all the platform info : Visual Studio 2005 (VB.NET) and ASP.NET 2.0.
3
5898
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, {System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. at...
0
9689
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9550
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10248
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10032
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9085
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7573
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5597
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4148
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.