c++mfcvisual-studio-2005cfiledialog

CFileDialog freezes when launched from Modeless Dialog


I'm attempting to call CFileDialog to allow the user to select a file.

My program is a MFC application and I am using VS2005.

Here is my problem:

I have main View that creates a modeless dialog box. In this dialog box I have a menu item that makes a simple CFileDialog call:

CFileDialog dlgFile(true);
dlgFile.DoModal();

But the program always hangs on the DoModal. The program does not respond to commands and Task manager says it has stopped responding.

Other interesting pieces of information:

The closest questions I could find is this: Why does CFileDialog::DoModal() Hang? However, I don't use threads (At least I'm 95% sure I don't, this isn't just my project). Is my project automatically being threaded? If so, how can I make sure that isn't causing me problems?


Solution

  • I've the same problem in VS2008. Try to set to false the last parameter in CFileDialog constructor (bVistaStyle)