search and use user's Documents folder on Windows
This commit is contained in:
16
src/app.cpp
16
src/app.cpp
@@ -114,10 +114,26 @@ void App::initLog()
|
|||||||
//sprintf_s(path, "%s%s", out_drive, out_path);
|
//sprintf_s(path, "%s%s", out_drive, out_path);
|
||||||
//data_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];
|
CHAR path[MAX_PATH];
|
||||||
GetCurrentDirectoryA(sizeof(path), path);
|
GetCurrentDirectoryA(sizeof(path), path);
|
||||||
data_path = path;
|
data_path = path;
|
||||||
|
}
|
||||||
|
|
||||||
rec_path = data_path + "\\frames";
|
rec_path = data_path + "\\frames";
|
||||||
|
if (!PathFileExistsA(rec_path.c_str()))
|
||||||
|
CreateDirectoryA(rec_path.c_str(), NULL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//LogRemote::I.start();
|
//LogRemote::I.start();
|
||||||
|
|||||||
@@ -13,10 +13,6 @@
|
|||||||
#include <deque>
|
#include <deque>
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
|
|
||||||
#pragma comment (lib, "opengl32.lib")
|
|
||||||
#pragma comment (lib, "glew32.lib")
|
|
||||||
#pragma comment(lib, "wbemuuid.lib")
|
|
||||||
|
|
||||||
#define WM_USER_CLOSE (WM_USER + 1)
|
#define WM_USER_CLOSE (WM_USER + 1)
|
||||||
|
|
||||||
LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp);
|
LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp);
|
||||||
|
|||||||
@@ -16,4 +16,8 @@
|
|||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#pragma comment(lib, "BugTrapU-x64.lib")
|
#pragma comment(lib, "BugTrapU-x64.lib")
|
||||||
#pragma comment(lib, "shell32.lib")
|
#pragma comment(lib, "shell32.lib")
|
||||||
|
#pragma comment(lib, "opengl32.lib")
|
||||||
|
#pragma comment(lib, "glew32.lib")
|
||||||
|
#pragma comment(lib, "wbemuuid.lib")
|
||||||
|
#pragma comment(lib, "Shlwapi.lib")
|
||||||
#endif // _WIN32
|
#endif // _WIN32
|
||||||
|
|||||||
Reference in New Issue
Block a user