From a1c91f4695e208d5a8f80dc37b1818169b7829ff Mon Sep 17 00:00:00 2001 From: Daniel Wilhelm Date: Fri, 18 Apr 2014 17:24:59 +0200 Subject: 5.17 --- ui/IFileDialog_Vista/ifile_dialog.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'ui/IFileDialog_Vista/ifile_dialog.cpp') diff --git a/ui/IFileDialog_Vista/ifile_dialog.cpp b/ui/IFileDialog_Vista/ifile_dialog.cpp index 19dcbc5d..f56df9e7 100644 --- a/ui/IFileDialog_Vista/ifile_dialog.cpp +++ b/ui/IFileDialog_Vista/ifile_dialog.cpp @@ -17,13 +17,13 @@ using namespace zen; namespace { -bool showFolderPickerImpl(HWND ownerWindow, //throw ComError; return "false" if cancelled by user +bool showFolderPickerImpl(HWND ownerWindow, //throw SysError; return "false" if cancelled by user const wchar_t* defaultFolder, //optional! const GUID* persistenceGuid, // std::wstring& selectedFolder) { ComPtr fileDlg; - ZEN_COM_CHECK(::CoCreateInstance(CLSID_FileOpenDialog, //throw ComError + ZEN_COM_CHECK(::CoCreateInstance(CLSID_FileOpenDialog, //throw SysError nullptr, CLSCTX_ALL, IID_PPV_ARGS(fileDlg.init()))); @@ -32,7 +32,7 @@ bool showFolderPickerImpl(HWND ownerWindow, //throw ComError; return "false" if ZEN_COM_CHECK(fileDlg->SetClientGuid(*persistenceGuid)); FILEOPENDIALOGOPTIONS dlgOptions = 0; - ZEN_COM_CHECK(fileDlg->GetOptions(&dlgOptions)); //throw ComError + ZEN_COM_CHECK(fileDlg->GetOptions(&dlgOptions)); //throw SysError ZEN_COM_CHECK(fileDlg->SetOptions(dlgOptions | FOS_PICKFOLDERS | FOS_NOVALIDATE | FOS_FORCEFILESYSTEM)); if (defaultFolder) //show last selection instead of top level if no default available @@ -48,7 +48,7 @@ bool showFolderPickerImpl(HWND ownerWindow, //throw ComError; return "false" if { ZEN_COM_CHECK(fileDlg->Show(ownerWindow)); //may fail with: HRESULT_FROM_WIN32(ERROR_CANCELLED) } - catch (const ComError&) { return false; } + catch (const SysError&) { return false; } ComPtr folderItem; ZEN_COM_CHECK(fileDlg->GetResult(folderItem.init())); @@ -90,12 +90,12 @@ void ifile::showFolderPicker(void* ownerWindow, ::memcpy(&winGuid, guid, sizeof(GUID)); std::wstring folderPath; - if (showFolderPickerImpl(static_cast(ownerWindow), defaultFolder, guid ? &winGuid : nullptr, folderPath)) //throw ComError + if (showFolderPickerImpl(static_cast(ownerWindow), defaultFolder, guid ? &winGuid : nullptr, folderPath)) //throw SysError selectedFolder = allocString(folderPath); else cancelled = true; } - catch (const ComError& e) + catch (const SysError& e) { errorMsg = allocString(e.toString()); //std::bad_alloc ? } -- cgit