Encountered an issue in open file dialog from CFileDialog (VC++) in windows 10 OS

  • Thread starter Thread starter RaviDesai
  • Start date Start date
R

RaviDesai

Guest
Hi Team,

I work on vc++ development using visual studio 2008 as IDE, I recently upgraded my system to windows 10 from windows 7 OS. I have encountered a strange issue in open file dialog when my Visual studio is in debug mode, I have source code which does a file selection and based on CFileDialog msdn class, which used to work on Windows 7 OS, where as in windows 10, when i run my application and click on a button to do file selection; windows UI hangs and doesn't respond and doesnot display the set of files to be selected. To stop this I have to stop debugging my code that's the possible way i found. I checked the microsoft forums and came to know that many developers face the issue of open file dialog in windows 10. Its a case of backward compatibility, Please resolve it if its an issue or if there is any fix for it, please suggest the fix with clear steps.

Regards
Ravikiran Desai

Current VS 2008 version:
9.0.30729.1 SP

void CxxxxxDlg::OnBnClickedButtonActivateScenario()
{
// TODO: Add your control notification handler code here
CWnd pParent;
CString pathFileName;
CString fileName = "*";
CString fFilter,extension,temp;
CString title="Open Script File";
int ok=-1;
CScenarioCompiler* aCompiler;
CScenarioScript *aScenario=NULL;
CString warning="",err="";

fFilter = "Script file (*.*)|*.*||";
extension = "";
try
{
CFileDialog fileDlg(TRUE, NULL, fileName + extension,
/*OFN_ALLOWMULTISELECT | */ OFN_HIDEREADONLY | OFN_EXPLORER | OFN_ENABLETEMPLATE,
fFilter, this->GetWindow(GW_OWNER), 0, FALSE ) ;
fileDlg.m_ofn.lpTemplateName = MAKEINTRESOURCE( IDD_CUSTOM_FILE_DLG ) ;
fileDlg.m_ofn.lStructSize = sizeof (OPENFILENAME) ;
fileDlg.m_ofn.lpstrTitle = title ;
fileDlg.m_ofn.hwndOwner = this->m_hWnd;
if (fileDlg.DoModal () == IDOK)
{

//*******************************************************

//windows UI hangs here and not able to select a file

pathFileName = fileDlg.GetPathName();

Continue reading...
 
Back
Top