Jump to content
  • Advertisement
Sign in to follow this  
nuclear123

C++/CLI System.AccessViolationException problem

This topic is 2560 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

i'm currently wanting to port my C++ programs to C++/CLI so i can create the User interface there instead of doing it in pure WIN32. The problem is my program does some CORRECT and LEGITIMATE writes to some external process. Unfortunately C++/CLI throws an exception when i allow it to do so with the following exception message

An unhandled exception of type 'System.AccessViolationException' occurred in Memory.exe

Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.



Is there any possible way for me to ignore/let this Read/Write to protected memory happen?


Share this post


Link to post
Share on other sites
Advertisement
I don't think there's a way to tell the program to access the protected memory anyway, after all, that's why it's protected.

It would really help if you could show us that code that causes this, but from personal experience, I would suggest that you go over to the declaration of the variable/function who's access is causing this and make sure it's not preceeded by the protected keyword. CLI tends to shove those protecteds at the worst places and cause all kinds of mischief when you add new components from the editor. It's something you should really pay attention to when adding new controls.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!