Error on Me.Close() event of form RRS feed

  • Question

  • I have a VB.NET application writtene using VS 2008 and have been receiving a weird error when a form is closed - it gives me the following error message:

    Windows has triggered a breakpoint in MyApplication.exe.

    This may be due to a corruption of the heap, which indicates a bug in MyApplication.exe or any of the DLLs it has loaded.

    This may also be due to the user pressing F12 while MyApplication.exe has focus.

    The output window may have more diagnostic information.

    The immediate window then has this error message:

    Critical error detected c0000374

    I tried fixing this by just hiding the window, but this simply moves the error up the chain and I get an error when exiting the program as it tries to close the form:

    Unhandled exception at 0x7700e29b in MyApplication.exe: 0xC0000005: Access violation writing location 0x00000000.

    I don't think I'm doing anything particularly strange in my application - reading from and writing to a database is about as complicated as anything gets for me. I've tried using AppVerifier, but then the program won't even open. I'm at a real loss as I don't know anything about memory management, or what a heap is. I just can't work out why this error is happening - can anyone help out?

    By the way, the application compiles and runs fine on my old 32-bit computer running WinXP professional, but my new 64-bit Windows 7 computer is just not having it, even though I have targeted the compile for x86 and followed every bit of advice I could find on geting it to work in Windows 7. Should Windows 7 and VS 2008 really be incompatible? Do I need to get VS 2010 instead?

    Thanks for any help anyone can offer


    Wednesday, September 15, 2010 5:56 PM


  • you have to use application.close rather than just me.close.....so os get that event even if you run your application as baground application.....


    • Marked as answer by Martin_Xie Monday, September 27, 2010 6:13 PM
    Wednesday, September 15, 2010 6:04 PM