Why is CFileDialog :: DoModal () freezing?

I developed a fairly large C ++ program in VS 6.0 on the Win XP platform and now I switched to a new machine running Win 7 (VS 6.0 is still running). The code includes a function to create and run a CFileDialog object to search for and open an ASCII file with a specific extension from a specific source directory. But now the program freezes on the line

if (t1.DoModal()==IDOK)

... where t1 is an instance of CFileDialog. To find out why the standard CfileDialog class stops working, I created a separate test project in VS 6.0 with a simple one-button dialog box containing this code:

void CFileDialogTestDlg::OnOpenFileDialogButton() 
{
  CFileDialog t1(true);
  if(t1.DoModal()==IDOK)
  {
    CString s3=t1.GetPathName();
    MessageBox(s3);
  }
}

This test works great and displays a useful file dialog box. I can also duplicate what I want in my large project, in terms of the initial directory, etc., Changing the m_ofn members from t1.

(.. ) - DoModal(). , MS, .

stackspace (400 ), , .

- , stackspace , , , , ?

+4
2

, . - , , , , , - .

+2

PostMessage() API , . ( ) , / , .

Windows, .

+2

Source: https://habr.com/ru/post/1547599/


All Articles