Link to home
Start Free TrialLog in
Avatar of jhattingh
jhattingh

asked on

CFileDialog Question...

When I use CFileDialog, giving users the ability to sort by file type through the use of the drop-down list, how do I know what they "chose"?

You see, I'm finding that people often don't put a file extension because they believe (understandably) that the context will dictate the file extension, and it's causing me a small headache.

Avatar of Paul Maker
Paul Maker
Flag of United Kingdom of Great Britain and Northern Ireland image

try

CString CFileDialog::GetFileExt();
Avatar of jhattingh
jhattingh

ASKER

This is what I am currently doing:

strOutputPath     = dlg.GetPathName();
strExt          = dlg.GetFileExt();
strTitle     = dlg.GetFileTitle();

if (strExt.IsEmpty())
{
   AfxMessageBox("Please browse again and specify a file extension for your output file");
   return false;
}


strExt *does* come up empty...


Thanks for the response...
ASKER CERTIFIED SOLUTION
Avatar of BogdyPtr
BogdyPtr

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial