summaryrefslogtreecommitdiff
path: root/ui/IFileDialog_Vista/ifile_dialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ui/IFileDialog_Vista/ifile_dialog.cpp')
-rw-r--r--ui/IFileDialog_Vista/ifile_dialog.cpp12
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 ?
}
bgstack15