Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
385
Error "Attempted to read or write protected memory. This is often an indication that other memory is corrupt."
posted

I am using a WinForms .NET 3.5 application written in C# running in Visual Studio 2010 and on Windows 7 Enterprise edition with Service Pack 1 installed.  We are using NetAdvantage for WinForms version 11.1

When trying to load the main form we are getting the error "Attempted to read or write protected memory. This is often an indication that other memory is corrupt.". 

The specific line of code is:

Application

 

 

.Run(new FrmPrestoMain());

When the above line of code runs the form's intialization code runs, the database connections run, and the grid is populated with data.  After that logic is run we get the error message.

Interestingly when I step through the code and allow the system time we don't get the error message.  This application is running fine in the same environment as described above, but using Windows XP with no issues.

  • 469350
    Offline posted

    Hi,

    What leads you to beleive that this is related to the WinGrid?

    Have you tried setting Visual Studio to break on all run-time exceptions? Sometime when you get an exception on Application.Run, it's because the exception really occurred somewhere else, but it's being caught and bubbling up, so you might be able to get more information by breaking on all exceptions.

    You can also take out the DebuggerStepThrough attribute on the InitializeComponent method of the form and sometimes that will help narrow down exactly what line of code the problem is occuring on.

    There's really not enough information here for me to guess what the problem is. Can you reproduce this issue in a small sample project and post it here so I can run it?