Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Why am I getting this error "Attempted to read or write protected memory....."? [modified]

Why am I getting this error "Attempted to read or write protected memory....."? [modified]

Scheduled Pinned Locked Moved C#
csharphelpquestionc++visual-studio
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Khoramdin
    wrote on last edited by
    #1

    Hello everyone, I have a WebBrowser Control in Windows Application. As the user Navigate using the Web Browser Control if the site tries to open a new Window using script I get the following error.

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

    I also tried the code given here http://www.codeproject.com/KB/cpp/ExtendedWebBrowser.aspx[^] and same error was given. I am using Visual Studio C# 2008. Can anyone tell me what is going on and how I can sort this out? Thank you very much for your help and have a great day. Khoramdin

    modified on Sunday, December 09, 2007 11:07:25 PM

    S 1 Reply Last reply
    0
    • K Khoramdin

      Hello everyone, I have a WebBrowser Control in Windows Application. As the user Navigate using the Web Browser Control if the site tries to open a new Window using script I get the following error.

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

      I also tried the code given here http://www.codeproject.com/KB/cpp/ExtendedWebBrowser.aspx[^] and same error was given. I am using Visual Studio C# 2008. Can anyone tell me what is going on and how I can sort this out? Thank you very much for your help and have a great day. Khoramdin

      modified on Sunday, December 09, 2007 11:07:25 PM

      S Offline
      S Offline
      Sathesh Sakthivel
      wrote on last edited by
      #2

      What does the debugger say. If an error is reproducable in this way you can be lucky. The reasons are many: Overwritten memory, buffer overrun, unlocked pointer, pointer to a pined managed object were the pn is freed, but the pointer is still in use... Repro the error in the debugger and watch the call stack.

      SSK. Anyone who says sunshine brings happiness has never danced in the rain.

      N 1 Reply Last reply
      0
      • S Sathesh Sakthivel

        What does the debugger say. If an error is reproducable in this way you can be lucky. The reasons are many: Overwritten memory, buffer overrun, unlocked pointer, pointer to a pined managed object were the pn is freed, but the pointer is still in use... Repro the error in the debugger and watch the call stack.

        SSK. Anyone who says sunshine brings happiness has never danced in the rain.

        N Offline
        N Offline
        N a v a n e e t h
        wrote on last edited by
        #3

        Vri SSK wrote:

        What does the debugger say. If an error is reproducable in this way you can be lucky. The reasons are many: Overwritten memory, buffer overrun, unlocked pointer, pointer to a pined managed object were the pn is freed, but the pointer is still in use... Repro the error in the debugger and watch the call stack.

        http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=148108&SiteID=1[^]

        All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups