Attempted to read or write protected memory. This is often an indication that other memory is corrup

S

Sugandh Jain

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.

Regards,
Sugandh Jain
 
K

Kevin Spencer

Are you using any Interop in the application?

--
HTH,

Kevin Spencer
Microsoft MVP

Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,

Sugandh Jain said:
Hi,
I am getting the error message
Attempted to read or write protected memory. This is often an indication
that other memory is corrupt.

What other memory?

You need to provide more details about your app
 
S

Sugandh Jain

Hi,

This whole sentence is the part of error message. even I am wondering what
other memory it is talking about.

It is a Windows Based application and I am getting it in the getter of self
defined Indexer for a collection class..
code for the indexer is as follows:

public Position this[Guid positionIdToFind]
{
get
{
Position foundPosition = null;

foreach (Position position in this)
{
if (position.ID.Equals(positionIdToFind))
{
foundPosition = position;
break;
}
}

return foundPosition;

}
set
{
for (int i = 0; i < this.Count; i++)
{
if (this.ID.Equals(positionIdToFind))
{
this = value;
break;
}
}
}
}

Is there somethingwrong with this indexer?



Regards,

Sugandh
 
G

Guest

Kevin Spencer said:
Are you using any Interop in the application?

--
HTH,

Kevin Spencer
Microsoft MVP

Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net
I am getting the same error in a VS.NET 2005 application working with
Oracle9i Client 9.2.0.1.0.

The error occurs when I call an "oracleConnection.Open()". The application
hangs, and debugging got me this error message.

By the way, I AM using Interop.PCMCOMLib.

I've been chasing this error for some time now and you mentioning Interop
gave me some hope you might know something that could help me.

The message only appears on a couple of PCs, and is working fine for the
others.

So, any ideas?
 
A

Alx

Hi,

This is the scene:

I have a dll which processes a text file input of data. The data referenced
in the Text file is extracted from the Db and loaded into datasets, where it
worked on, then when completed, uploaded back into the Db.

Here's the issue:
When processing small files, everything is cool. But when doing a 10k or
more line file, I get the same error message as described in this thread.

Now, I do use a unmanaged dll written in Deplhi, but if that is the problem,
why is all smooth when processing small (3k lines) files.

Hope you can help!

Sugandh Jain said:
Hi,

This whole sentence is the part of error message. even I am wondering what
other memory it is talking about.

It is a Windows Based application and I am getting it in the getter of self
defined Indexer for a collection class..
code for the indexer is as follows:

public Position this[Guid positionIdToFind]
{
get
{
Position foundPosition = null;

foreach (Position position in this)
{
if (position.ID.Equals(positionIdToFind))
{
foundPosition = position;
break;
}
}

return foundPosition;

}
set
{
for (int i = 0; i < this.Count; i++)
{
if (this.ID.Equals(positionIdToFind))
{
this = value;
break;
}
}
}
}

Is there somethingwrong with this indexer?



Regards,

Sugandh









Ignacio Machin ( .NET/ C# MVP ) said:
Hi,



What other memory?

You need to provide more details about your app
 
P

Patrick

Im getting the exact same error message in a small winform application that I
converted from 1.1 to 2.0. The error occurs only on some of the PCs in which
the application is installed on. The error occurs specificaly in the
InitializeComponent method when setting the properties of a tab control.
What makes this really strange is that when I remote desktop connect to the
pc, the application will work correctly but when I login at the desktop it
will not work.

Below is a code snipet from the InitializeComponent() method where the code
crashes:

this.tabControl1.Alignment = System.Windows.Forms.TabAlignment.Bottom;
this.tabControl1.AllowDrop = true;
this.tabControl1.Controls.Add(this.tabProduction);
this.tabControl1.Controls.Add(this.tabProdSupp);
this.tabControl1.Controls.Add(this.tabOther);
this.tabControl1.Controls.Add(this.tabDevelopment);
this.tabControl1.Controls.Add(this.tabTest);
this.tabControl1.Controls.Add(this.tabUA);
this.tabControl1.Location = new System.Drawing.Point(15, 12);
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(295, 285);
this.tabControl1.TabIndex = 0;


Thanks,

Patrick
 

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