Skip to content

Commit 1f4c0fb

Browse files
committed
[WIndows] Dialog::SaveFile() で defaultPath に U"./" を指定できるように #1240
1 parent 3adfe86 commit 1f4c0fb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Siv3D/src/Siv3D-Platform/WindowsDesktop/Siv3D/Dialog/SivDialog_Windows.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,11 @@ namespace s3d
7272
return true;
7373
}
7474

75+
const FilePath fullPath = FileSystem::FullPath(defaultPath);
76+
const std::wstring nativePath = FileSystem::NativePath(fullPath);
77+
7578
ComPtr<IShellItem> folder;
76-
HRESULT result = ::SHCreateItemFromParsingName(String{ defaultPath }.replaced(U'/', U'\\').toWstr().c_str(), nullptr, IID_PPV_ARGS(folder.GetAddressOf()));
79+
HRESULT result = ::SHCreateItemFromParsingName(nativePath.c_str(), nullptr, IID_PPV_ARGS(folder.GetAddressOf()));
7780

7881
if (result == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)
7982
|| result == HRESULT_FROM_WIN32(ERROR_INVALID_DRIVE))

0 commit comments

Comments
 (0)