我在VC ++中开发了windows应用程序。我正在使用CFileDialog来显示一个对话框。然而,当我右键单击对话框时,它崩溃了。相同的代码在XP中运行良好。我读了一些不再支持Vista风格的地方。所以我修改了代码如下。我还是崩溃了
CFileDialog dlg(FALSE, _T("*.xml"),strFileName ,OFN_HIDEREADONLY,
_T("(*.xml)|*.xml|(*.*)|*.*||"), NULL, 0,FALSE);
if (IDOK == dlg.DoModal()) //crash here on right click
{
//CString folder = dlg.GetFolderPath();
strFileName = dlg.GetPathName();
SetFileName ( T2CW (strFileName));
}
以下是堆栈跟踪
OLE32!CServerContextActivator ::的CreateInstance + 245 OLE32!ActivationPropertiesIn :: DelegateCreateInstance + 5E OLE32!CApartmentActivator ::的CreateInstance + 88 OLE32!CProcessActivator :: CCICallback + 4E OLE32!CProcessActivator :: AttemptActivation + 33 OLE32!CProcessActivator :: ActivateByContext + 1408米 OLE32!CProcessActivator ::的CreateInstance + 77 OLE32!ActivationPropertiesIn :: DelegateCreateInstance + 5E OLE32!CClientContextActivator ::的CreateInstance + EB OLE32!ActivationPropertiesIn :: DelegateCreateInstance + 5E OLE32!ICoCreateInstanceEx + 5f5 OLE32!CoCreateInstance的+ 17B SHELL32!_SHCoCreateInstance + 209 SHELL32!SHExtCoCreateInstance + 28 SHELL32!DCA_SHExtCoCreateInstance + 3D SHELL32!HDXA_QueryContextMenu + 287 SHELL32!CDefFolderMenu :: QueryContextMenu + 625 SHELL32!CContextMenuOnContextMenuArray :: _ QueryNthContextMenu SHELL32!CContextMenuOnContextMenuArray :: QueryContextMenu + B0 SHELL32!CDefView :: _ DoContextMenuPopup + 19D SHELL32!CDefView :: OnBackgroundContextMenu + 2D1 SHELL32!CListViewHost :: ShowContextMenu + 1F1 SHELL32!CDefView :: _ OnContextMenu + 110 SHELL32!CDefView :: WndProc中+ 889 SHELL32!CDefView :: s_WndProc + 7C USER32!UserCallWinProcCheckWow + 1AD USER32!CallWindowProcAorW + DC USER32!CallWindowProcW + 18 comctl32_7fefbdd0000!CallOriginalWndProc + 1D comctl32_7fefbdd0000!CallNextSubclassProc + 8C comctl32_7fefbdd0000!DefSubclassProc + 7C SHELL32!DefSubclassProc + 56 SHELL32!CListViewHost :: _ ViewSubclassWndProc + 3E1 SHELL32!CListViewHost :: s_ViewSubclassWndProc + 4F comctl32_7fefbdd0000!CallNextSubclassProc + 8C comctl32_7fefbdd0000!MasterSubclassProc + E7 USER32!UserCallWinProcCheckWow + 1AD USER32!DispatchClientMessage + C3 USER32!_fnDWORD + 2D NTDLL!KiUserCallbackDispatcherContinue USER32!ZwUserMessageCall +一 USER32!RealDefWindowProcWorker + A4 USER32!RealDefWindowProcW + 5A 的Uxtheme!DoMsgDefault + 2A 的uxtheme!OnDwpContextMenu + EF 的Uxtheme!_ThemeDefWindowProc + 209 的Uxtheme!ThemeDefWindowProcW + 11 USER32!DefWindowProcW + E6 comctl32_7fefbdd0000!CListView中:: WndProc中+ 2A42 comctl32_7fefbdd0000!CListView中:: s_WndProc + 6CD USER32!UserCallWinProcCheckWow + 1AD USER32!CallWindowProcAorW + DC USER32!CallWindowProcW + 18 comctl32_7fefbdd0000!CallOriginalWndProc + 1D comctl32_7fefbdd0000!CallNextSubclassProc + 8C comctl32_7fefbdd0000!DefSubclassProc + 7C SHELL32!DefSubclassProc + 56 SHELL32!CListViewHost :: s_ListViewSubclassWndProc + 31E comctl32_7fefbdd0000!CallNextSubclassProc + 8C comctl32_7fefbdd0000!MasterSubclassProc + E7 USER32!UserCallWinProcCheckWow + 1AD USER32!SendMessageWorker + 682 USER32!SendMessageW + 5℃ comctl32_7fefbdd0000!CLVMouseManager :: HandleMouse + F8C comctl32_7fefbdd0000!CListView中:: WndProc中+ 9dc comctl32_7fefbdd0000!CListView中:: s_WndProc + 6CD USER32!UserCallWinProcCheckWow + 1AD USER32!CallWindowProcAorW + DC USER32!CallWindowProcW + 18 comctl32_7fefbdd0000!CallOriginalWndProc + 1D comctl32_7fefbdd0000!CallNextSubclassProc + 8C comctl32_7fefbdd0000!DefSubclassProc + 7C SHELL32!DefSubclassProc + 56 SHELL32!CListViewHost :: s_ListViewSubclassWndProc + 31E comctl32_7fefbdd0000!CallNextSubclassProc + 8C comctl32_7fefbdd0000!MasterSubclassProc + E7 USER32!UserCallWinProcCheckWow + 1AD USER32!DispatchMessageWorker + 3B5 USER32!IsDialogMessageW + 153 USER32!DialogBox2 + 197 USER32!InternalDialogBox + 135 USER32!DialogBoxIndirectParamAorW + 58 USER32!DialogBoxIndirectParamW + 18 COMDLG32!CFileOpenSave ::展会+ 1AF COMDLG32!_InvokeNewFileOpenSave + DB COMDLG32!CSTADialog :: s_DialogThreadProc + 2D SHLWAPI!WrapperThreadProc + 19B KERNEL32!BaseThreadInitThunk + d NTDLL!RtlUserThreadStart + 1D
答案 0 :(得分:0)
如果从上下文菜单中禁用NVIDIA CPL上下文菜单扩展,问题就会得到解决。然而,它仍然是一个谜,因为相同的代码适用于其他应用程序。