search and use user's Documents folder on Windows
This commit is contained in:
22
src/app.cpp
22
src/app.cpp
@@ -114,10 +114,26 @@ void App::initLog()
|
||||
//sprintf_s(path, "%s%s", out_drive, out_path);
|
||||
//data_path = path;
|
||||
|
||||
CHAR path[MAX_PATH];
|
||||
GetCurrentDirectoryA(sizeof(path), path);
|
||||
data_path = path;
|
||||
|
||||
CHAR my_documents[MAX_PATH];
|
||||
HRESULT result = SHGetFolderPathA(NULL, CSIDL_PERSONAL, NULL, SHGFP_TYPE_CURRENT, my_documents);
|
||||
if (SUCCEEDED(result))
|
||||
{
|
||||
std::string path = std::string(my_documents) + "\\PanoPainter";
|
||||
if (!PathFileExistsA(path.c_str()))
|
||||
CreateDirectoryA(path.c_str(), NULL);
|
||||
App::I.data_path = path;
|
||||
}
|
||||
else
|
||||
{
|
||||
CHAR path[MAX_PATH];
|
||||
GetCurrentDirectoryA(sizeof(path), path);
|
||||
data_path = path;
|
||||
}
|
||||
|
||||
rec_path = data_path + "\\frames";
|
||||
if (!PathFileExistsA(rec_path.c_str()))
|
||||
CreateDirectoryA(rec_path.c_str(), NULL);
|
||||
#endif
|
||||
|
||||
//LogRemote::I.start();
|
||||
|
||||
Reference in New Issue
Block a user