Share via

Delayed crash when using CFileDialog or GetOpenFileName - Windows 10, x64 application

Dominic Benvegnu 1 Reputation point
2021-01-09T00:23:31.11+00:00

I am using Visual Studio 2017 to write a 64-bit application (Windows 10). When I use CFileDialog or GetOpenFileName the program exhibits a delayed crash. The CFileDialog operation seems to work fine. I open the file, process the data, and then the program crashes long after the CFileDialog has closed. The location and timing of the crash varies, but the call stack always points to a heap error. When I eliminate the use CFileDialog (or GetOpenFileName), there is no crashing.

There was a similar problem with CFileDialog associated with Windows 7 and Windows 8 as discussed at stackoverflow.com/questions/12388182/cfiledialog-delayed-crashing.

How can I troubleshoot this problem? Is there a fix for Windows 10 x64?

Developer technologies | Visual Studio | Debugging

1 answer

Sort by: Most helpful
  1. 大钧 徐 1 Reputation point
    2021-01-09T00:33:15.737+00:00

    Try using two dynamic environment variables.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.