locked
Second use of CFileDialog RRS feed

  • Question

  • Hello together,

    in Visual Studio 2010 there is the bug in second use of CFileDialog::DoModal(). More information under links:

    • http://microsoft.public.vc.mfc.narkive.com/14GjcBWK/exception-in-cfiledialog-why
    • http://wenda.soso.io/questions/4437936/second-use-of-cfiledialog-in-my-program-gets-the-run-time-error-debug-assertion

    Has this bug been fixed in VS 2010 or in some younger version?

    Thanks

    Olin.

    • Moved by Jiayi Li Monday, August 10, 2015 5:47 AM
    Thursday, August 6, 2015 6:26 AM

Answers

  • Hello together,

    in Visual Studio 2010 there is the bug in second use of CFileDialog::DoModal(). More information under links:

    • http://microsoft.public.vc.mfc.narkive.com/14GjcBWK/exception-in-cfiledialog-why
    • http://wenda.soso.io/questions/4437936/second-use-of-cfiledialog-in-my-program-gets-the-run-time-error-debug-assertion

    Has this bug been fixed in VS 2010 or in some younger version?

    Thanks

    Olin.

    You do not describe your problem very well, but if you are calling DoModal() a second time on the same CDialog object, I do seem to remember that there is some bug in MFC that prevents this from working correctly. This problem was not specific to CFileDialog.

    Can you not use a different CFileDialog object for each call?


    David Wilkinson | Visual C++ MVP

    • Marked as answer by Shu 2017 Monday, August 24, 2015 6:11 AM
    Monday, August 10, 2015 8:42 AM
  • Are you using same handle again without closing it, may be this problem is using resource again and again without freeing them properly.

    Thanks


    Rupesh Shukla

    • Marked as answer by Shu 2017 Monday, August 24, 2015 6:11 AM
    Tuesday, August 11, 2015 3:43 PM

All replies

  • Hi Olin,

    This forum is about Visual Studio IDE, as your issue is about CFileDialog::DoModal(), it is related to Visual C++, I help you move this case to Visual C++ forum for better assist.

    Best Regards,

    Jiayi Li


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.

    Click HERE to participate the survey.

    Monday, August 10, 2015 5:47 AM
  • Hello together,

    in Visual Studio 2010 there is the bug in second use of CFileDialog::DoModal(). More information under links:

    • http://microsoft.public.vc.mfc.narkive.com/14GjcBWK/exception-in-cfiledialog-why
    • http://wenda.soso.io/questions/4437936/second-use-of-cfiledialog-in-my-program-gets-the-run-time-error-debug-assertion

    Has this bug been fixed in VS 2010 or in some younger version?

    Thanks

    Olin.

    You do not describe your problem very well, but if you are calling DoModal() a second time on the same CDialog object, I do seem to remember that there is some bug in MFC that prevents this from working correctly. This problem was not specific to CFileDialog.

    Can you not use a different CFileDialog object for each call?


    David Wilkinson | Visual C++ MVP

    • Marked as answer by Shu 2017 Monday, August 24, 2015 6:11 AM
    Monday, August 10, 2015 8:42 AM
  • Are you using same handle again without closing it, may be this problem is using resource again and again without freeing them properly.

    Thanks


    Rupesh Shukla

    • Marked as answer by Shu 2017 Monday, August 24, 2015 6:11 AM
    Tuesday, August 11, 2015 3:43 PM