Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 09-04-2009
Member
 
Join Date: Mar 2009
Posts: 92
Problem violation of the memory

Hello,
I get this error when I run a small program: "The exception System.AccessViolationException has not been managed Attempt to read or write protected memory. This often indicates that other memory is corrupt. " Detail: System.AccessViolationException " The program reads a database and is exploring in another database. The error never happens at the same location or even recording.

Thank you for your help
Reply With Quote
  #2  
Old 09-04-2009
Member
 
Join Date: Sep 2005
Posts: 2,321
Re: Problem violation of the memory

Are that it comes from the DLL, type badly allocated memory, release memory early attempt to access a memory area that has already been cleared but the pointer was not set to NULL, this kind of things will cause the problem.
Reply With Quote
  #3  
Old 09-04-2009
Member
 
Join Date: May 2006
Posts: 2,800
Re: Problem violation of the memory

hi,
An access violation occurs in unmanaged or unsafe code when the code attempts to read or write to memory that has not been allocated, or to which it does not have access. This usually occurs because a pointer has a bad value. Not all reads or writes through bad pointers lead to access violations, so an access violation usually indicates that several reads or writes have occurred through bad pointers, and that memory might be corrupted. Thus, access violations almost always indicate serious programming errors. In the .NET Framework version 2.0, an AccessViolationException clearly identifies these serious errors.
Reply With Quote
  #4  
Old 09-04-2009
Member
 
Join Date: May 2008
Posts: 1,807
Re: Problem violation of the memory

Now when you get this error its a bug in your code, pure and simple so you should really crash the application if possible but if for the sake of argument you had a .NET 1.x application which happened to detect this condition and work around it, the change to AccessViolationException would mean that .NET 2.0 has introduced a breaking change.
Reply With Quote
  #5  
Old 09-04-2009
Member
 
Join Date: May 2008
Posts: 2,008
Re: Problem violation of the memory

You are in VB2005, how do you declare the functions in your dll? It may be that the variable type that you password it will not correspond.

Another point is that your variables are properly instantiated before passing to the dll. Ex, if you pass it a string it must meet, this string must first be properly filled with enough characters for it exists in memory.

The best is that you put the piece of code that is problematic.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Problem violation of the memory"
Thread Thread Starter Forum Replies Last Post
Getting Memory Access Violation error into the RegisterClassEx function Wave Software Development 5 28-06-2011 11:08 AM
Problem of E55 Out of Memory or Memory Full Efigenio Portable Devices 5 22-09-2010 05:58 PM
Skype 4.2.0.169 access violation Shin-Chen Technology & Internet 6 12-08-2010 11:03 PM
Excel - Sharing Violation dave@at MS Office Support 6 28-10-2009 03:09 PM
Access violation or not Hajra Software Development 3 21-10-2009 04:35 PM


All times are GMT +5.5. The time now is 11:52 PM.