diff options
author | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:24:59 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:24:59 +0200 |
commit | a1c91f4695e208d5a8f80dc37b1818169b7829ff (patch) | |
tree | 52f5134376d17c99b6c9e53133a2eb5cf171377c /ui/IFileDialog_Vista/ifile_dialog.cpp | |
parent | 5.16 (diff) | |
download | FreeFileSync-a1c91f4695e208d5a8f80dc37b1818169b7829ff.tar.gz FreeFileSync-a1c91f4695e208d5a8f80dc37b1818169b7829ff.tar.bz2 FreeFileSync-a1c91f4695e208d5a8f80dc37b1818169b7829ff.zip |
5.17
Diffstat (limited to 'ui/IFileDialog_Vista/ifile_dialog.cpp')
-rw-r--r-- | ui/IFileDialog_Vista/ifile_dialog.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
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<IFileDialog> 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<IShellItem> 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<HWND>(ownerWindow), defaultFolder, guid ? &winGuid : nullptr, folderPath)) //throw ComError + if (showFolderPickerImpl(static_cast<HWND>(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 ? } |