Commit a595c119 authored by captainwong's avatar captainwong

update file_op

parent 295cdfc8
...@@ -46,7 +46,7 @@ inline bool get_file_open_dialog_result(std::wstring& path, HWND hWnd = nullptr) ...@@ -46,7 +46,7 @@ inline bool get_file_open_dialog_result(std::wstring& path, HWND hWnd = nullptr)
} }
inline bool get_save_as_dialog_path(std::wstring& path, HWND hWnd = nullptr) { inline bool get_save_as_dialog_path(std::wstring& path, const std::wstring& ext = L"", HWND hWnd = nullptr) {
bool ok = false; bool ok = false;
HRESULT hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | HRESULT hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED |
...@@ -61,6 +61,9 @@ inline bool get_save_as_dialog_path(std::wstring& path, HWND hWnd = nullptr) { ...@@ -61,6 +61,9 @@ inline bool get_save_as_dialog_path(std::wstring& path, HWND hWnd = nullptr) {
IID_IFileSaveDialog, reinterpret_cast<void**>(&pFileSave)); IID_IFileSaveDialog, reinterpret_cast<void**>(&pFileSave));
if (SUCCEEDED(hr)) { if (SUCCEEDED(hr)) {
pFileSave->SetDefaultExtension(ext.c_str());
// Show the Open dialog box. // Show the Open dialog box.
hr = pFileSave->Show(hWnd); hr = pFileSave->Show(hWnd);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment