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?

Visual Studio Debugging
Visual Studio Debugging
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Debugging: The act or process of detecting, locating, and correcting logical or syntactical errors in a program or malfunctions in hardware. In hardware contexts, the term troubleshoot is the term more frequently used, especially if the problem is major.
1,024 questions
{count} votes

1 answer

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

    Try using two dynamic environment variables.

    0 comments No comments

Your answer

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