search and use user's Documents folder on Windows

This commit is contained in:
2018-09-17 22:39:32 +02:00
parent dfc4a956ab
commit 93d31e0374
4 changed files with 24 additions and 7 deletions

View File

@@ -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();

View File

@@ -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);

View File

@@ -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

View File

@@ -77,6 +77,7 @@
#include <gl\GL.h> #include <gl\GL.h>
#include <BugTrap.h> #include <BugTrap.h>
#include <shlobj.h> #include <shlobj.h>
#include <shlwapi.h>
#define SHADER_VERSION "#version 150\n" #define SHADER_VERSION "#version 150\n"