المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Exception with CFileDialog (MFC)



C++ Programming
01-22-2011, 08:12 PM
Hi everyone! I had the following lines of C++ code in my program

CFileDialog dialog(true);
CString strFileName=L"";
INT_PTR nResult = dialog.DoModal();
if(nResult == IDOK)
// Exception spotted here
// Debug information gives me --> dialog = {CFileDialog hWnd=0x00000000}
// What's the heck?
strFileName=dialog.GetFolderPath(); The problem is: When I execute the program on a PC running Windows XP, there always have an ugly exception which I don't know why it happened. But everything's fine when I copied it to another PC running Windows 7.

I'm desperate. Would you guy please tell me why?
anhld