简体   繁体   中英

DialogBox crash in Win7

I have windows application developed in VC++. I am using a CFileDialog to display a dialog box . However the moment I right click on the dialog box , it crashes . The same code works fine in XP . I read some where that the Vista Style is no longer supported . So I modified the code as follows. Still I get a crash

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)); 

}

Following is the stack trace

ole32!CServerContextActivator::CreateInstance+245 ole32!ActivationPropertiesIn::DelegateCreateInstance+5e ole32!CApartmentActivator::CreateInstance+88 ole32!CProcessActivator::CCICallback+4e ole32!CProcessActivator::AttemptActivation+33 ole32!CProcessActivator::ActivateByContext+7f 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::_OnCo ntextMenu+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+a 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!CallWin dowProcAorW+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+5c 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!Di spatchMessageWorker+3b5 user32!IsDialogMessageW+153 user32!DialogBox2+197 user32!InternalDialogBox+135 user32!DialogBoxIndirectParamAorW+58 user32!DialogBoxIndirectParamW+18 comdlg32!CFileOpenSave::Show+1af comdlg32!_InvokeNewFileOpenSave+db comdlg32!CSTADialog::s_DialogThreadProc+2d shlwapi!WrapperThreadProc+19b kernel32!BaseThreadInitThunk+d ntdll!RtlUserThreadStart+1d

The issue gets resolved if I disable the NVDIA CPL Context Menu Extension from the context menu . However its still a mystery as the same code does work for other applications .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM