I have discovered a major bug in a simple program. The problem has a propertysheet. There are two pages the are almost exactly the same. Both pages have a CListCtrl box. In both pages, the user can add items, select items, and/or remove existing items.
For some reason, only one page worked in the *release* version of the program. Everything worked perfect in debug mode, but one page crashed in release. The page that crashed does so in the same manner every time. Below is a logs of the crash.
// debug log
// this occurs AFTER the user options a propertysheet
// program does NOT crash at this point
First-chance exception at 0x7196254a in myProgram: 0xC0000005: Access violation writing location 0x00463b2c.
// this occurs when the user selects an item in a CListCtrl box
// program crashes at this point
First-chance exception at 0x046936d7 in myProgram: 0xC0000005: Access violation reading location 0x046936d7.
Unhandled exception at 0x046936d7 in myProgram: 0xC0000005: Access violation reading location 0x046936d7.
The program ' myProgram: Native' has exited with code 128 (0x80).
I have no idea how to fix this problem. I have compared the two property pages I mentioned that have the CListCtrl boxes. The code in both property pages are flawless.
First, I thought the program crashed because there was a code program in the function that determines what item is selected in the CListCtrl box. However, I have found that the program does not crash at all inside that function. It crashed sometime after leaving the function.
Is this a memory problem? Please post if you have any idea on debugging this problem.