Why does my program always throw an access violation exception in mfc140d.dll?


The program crashes after 30-45 minutes of operation with the following message:

Exception Thrown at 0xFCA6551 (mfc140d.dll) in WinPDM.exe: 0xC0000005: Access Violation reading location 0x00000008.

The exception occurs when running in both debug mode and from a release build in Visual Studio 2017. The program suddenly shows errors in rendering boxes and buttons, and if one then tries to press a button or select an item, the exception occurs. The program was originally writtin in Visual C++ 6.0 and ported somewhat successfully to Visual Studio 2017. Many errors were found and removed after running the built-in intellisense analyzer in VS2017, but the exception still occurs. It also occurs in the older versions of the program built in Visual C++ 6.0. I am looking for suggestions on how to pinpoint where this error is coming from and how to address it.

We have already tried to backtrace using the VS2017 debugger, and also attempted to step into the function call where the exception occurs:

size = m_ShiftList.GetDC()->GetTextExtent(str);

but the debugger refuses to step into the function at this point. The program can pass through this point with no issues for the first 30-45 minutes of operation. Removing this code (since we can live without knowing the size of the text) moved the same exception to occur at a different point.

asked on Stack Overflow Apr 10, 2019 by EMyerson

0 Answers

Nobody has answered this question yet.

User contributions licensed under CC BY-SA 3.0