Click to See Complete Forum and Search --> : Common Dialog Failure


kronski
August 10th, 1999, 10:09 AM
Hi, I am just trying to open up a common dialog box, but it seems to sometimes close my program.

//Construct a file filter for the common dialog box
static char BASED_CODE szFilter[] = "HTML Files (*.htm)|*.htm|All Files (*.*)|*.*||";

//Open up a "Save As" commond dialog
CFileDialog cfd(FALSE, "htm", csSession, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, szFilter, NULL);

//If they cancelled lets get out of here
cfd.DoModal();




When I call the DoModal my program closes out. It is an SDI MFC app.

Wayne Fuller
August 10th, 1999, 10:23 AM
Check out what csSession is and make sure it is valid. I changed it to NULL and your code worked fine.

Wayne