Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/user-interface/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在Visual Studio 2010调试器中运行时,将不显示Windows公用文件对话框 我有一个VS2010 C++应用程序,它以普通的方式使用Windows公用文件对话框。我的公司刚刚用Windows7将我的工作站升级为一个不错的四核CPU,而我以前的系统仍然运行XP。当我在VisualStudio调试器中运行我的应用程序时,调用CFD的任何尝试似乎都会无声地失败,代码不会向输出窗口抛出明显的错误,也不会出现对话框。在调试器之外,一切正常。我每次调用对话框的方式基本相同 CString theFilterList = "CSV Import Files (*.csv)|*.csv"; theFilterList = theFilterList + "|All files (*.*)|*.*||"; // construct the common dialog CFileDialog fileDlg(TRUE, NULL, NULL,OFN_ENABLESIZING | OFN_EXPLORER | OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST | OFN_HIDEREADONLY | OFN_ALLOWMULTISELECT, theFilterList,this); POSITION pos; // Initialize m_ofn structure fileDlg.m_ofn.lpstrTitle = "Please select a UP supplied CSV file to prepare to load into SCT."; // Create buffer for file names. const DWORD bufferSize = (MAX_MULTISELECT_FILENAMES * MAX_FILENAMESIZE) + 1; TCHAR* filenamesBuffer = new TCHAR[bufferSize]; // Initialize beginning and end of buffer. filenamesBuffer[0] = NULL; filenamesBuffer[bufferSize-1] = NULL; // Attach buffer to OPENFILENAME member. fileDlg.m_ofn.lpstrFile = filenamesBuffer; fileDlg.m_ofn.nMaxFile = bufferSize; if ( fileDlg.DoModal() != IDOK) { theCSVFilenameList.RemoveAll(); return; } pos = fileDlg.GetStartPosition(); while( pos ) { theCSVFilenameList.Add(fileDlg.GetNextPathName( pos )); }_Windows_User Interface_Mfc_Dialog - Fatal编程技术网

在Visual Studio 2010调试器中运行时,将不显示Windows公用文件对话框 我有一个VS2010 C++应用程序,它以普通的方式使用Windows公用文件对话框。我的公司刚刚用Windows7将我的工作站升级为一个不错的四核CPU,而我以前的系统仍然运行XP。当我在VisualStudio调试器中运行我的应用程序时,调用CFD的任何尝试似乎都会无声地失败,代码不会向输出窗口抛出明显的错误,也不会出现对话框。在调试器之外,一切正常。我每次调用对话框的方式基本相同 CString theFilterList = "CSV Import Files (*.csv)|*.csv"; theFilterList = theFilterList + "|All files (*.*)|*.*||"; // construct the common dialog CFileDialog fileDlg(TRUE, NULL, NULL,OFN_ENABLESIZING | OFN_EXPLORER | OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST | OFN_HIDEREADONLY | OFN_ALLOWMULTISELECT, theFilterList,this); POSITION pos; // Initialize m_ofn structure fileDlg.m_ofn.lpstrTitle = "Please select a UP supplied CSV file to prepare to load into SCT."; // Create buffer for file names. const DWORD bufferSize = (MAX_MULTISELECT_FILENAMES * MAX_FILENAMESIZE) + 1; TCHAR* filenamesBuffer = new TCHAR[bufferSize]; // Initialize beginning and end of buffer. filenamesBuffer[0] = NULL; filenamesBuffer[bufferSize-1] = NULL; // Attach buffer to OPENFILENAME member. fileDlg.m_ofn.lpstrFile = filenamesBuffer; fileDlg.m_ofn.nMaxFile = bufferSize; if ( fileDlg.DoModal() != IDOK) { theCSVFilenameList.RemoveAll(); return; } pos = fileDlg.GetStartPosition(); while( pos ) { theCSVFilenameList.Add(fileDlg.GetNextPathName( pos )); }

在Visual Studio 2010调试器中运行时,将不显示Windows公用文件对话框 我有一个VS2010 C++应用程序,它以普通的方式使用Windows公用文件对话框。我的公司刚刚用Windows7将我的工作站升级为一个不错的四核CPU,而我以前的系统仍然运行XP。当我在VisualStudio调试器中运行我的应用程序时,调用CFD的任何尝试似乎都会无声地失败,代码不会向输出窗口抛出明显的错误,也不会出现对话框。在调试器之外,一切正常。我每次调用对话框的方式基本相同 CString theFilterList = "CSV Import Files (*.csv)|*.csv"; theFilterList = theFilterList + "|All files (*.*)|*.*||"; // construct the common dialog CFileDialog fileDlg(TRUE, NULL, NULL,OFN_ENABLESIZING | OFN_EXPLORER | OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST | OFN_HIDEREADONLY | OFN_ALLOWMULTISELECT, theFilterList,this); POSITION pos; // Initialize m_ofn structure fileDlg.m_ofn.lpstrTitle = "Please select a UP supplied CSV file to prepare to load into SCT."; // Create buffer for file names. const DWORD bufferSize = (MAX_MULTISELECT_FILENAMES * MAX_FILENAMESIZE) + 1; TCHAR* filenamesBuffer = new TCHAR[bufferSize]; // Initialize beginning and end of buffer. filenamesBuffer[0] = NULL; filenamesBuffer[bufferSize-1] = NULL; // Attach buffer to OPENFILENAME member. fileDlg.m_ofn.lpstrFile = filenamesBuffer; fileDlg.m_ofn.nMaxFile = bufferSize; if ( fileDlg.DoModal() != IDOK) { theCSVFilenameList.RemoveAll(); return; } pos = fileDlg.GetStartPosition(); while( pos ) { theCSVFilenameList.Add(fileDlg.GetNextPathName( pos )); },windows,user-interface,mfc,dialog,Windows,User Interface,Mfc,Dialog,我只是有这个问题。我发现我的储物空间太大了。我缩小了它,对话开始出现。虽然在我的例子中,它发生在调试器内外。罗杰,在我看来,没有愚蠢的问题,所以我很欣赏这个想法,即使不是这样。我很自豪(震惊;惊讶)地说,我从Windows1.1开始就一直在为Windows编写代码(哦,太恐怖了)。我想这种老式的风格需要为Win7+进行更新。我怀念那些技术人员运行MS而不是市场部的日子。感谢您的输入。那么,当您在调试器中执行fileDlg.DoModal()行时,会发生什么呢?什么是DoModal返回值?它是立即

我只是有这个问题。我发现我的储物空间太大了。我缩小了它,对话开始出现。虽然在我的例子中,它发生在调试器内外。

罗杰,在我看来,没有愚蠢的问题,所以我很欣赏这个想法,即使不是这样。我很自豪(震惊;惊讶)地说,我从Windows1.1开始就一直在为Windows编写代码(哦,太恐怖了)。我想这种老式的风格需要为Win7+进行更新。我怀念那些技术人员运行MS而不是市场部的日子。感谢您的输入。那么,当您在调试器中执行
fileDlg.DoModal()
行时,会发生什么呢?什么是
DoModal
返回值?它是立即返回还是挂起?我只是稍微更改了代码以便可以看到值-它似乎立即返回IDCANCEL,而不首先显示对话框“/*if(fileDlg.DoModal()!=IDOK){return;}*/int-iResult=fileDlg.DoModal();如果(iResult!=IDOK){return;}调试环境中存在导致此行为的某种因素。您需要使用MFC源代码调试
DoModal
。我在Windows 7中没有遇到这样的问题。这些对话框可能以难以诊断的方式失败,因为它们将外壳扩展处理程序加载到您的进程中。您可以在输出窗口中轻松看到,它显示了一组DLL的加载通知。行为不端的人可能会引起随机的麻烦。比如说,某种DRM组件不喜欢看到附加了调试器。运行SysInternals的AutoRuns实用程序并禁用任何没有Microsoft版权的shell扩展处理程序。通过二进制搜索缩小麻烦制造者的范围。