I can't get C++ to work with the "ms-appdata:///roaming/" call to retrieve files
I am currently using cpp to write a Chinese Input Method Editor, and it is packaged as a dll.
Therefore, when I make a call to ifstream to read my Settings File, file permissions are limited by whichever application is active, such as for when a Universal Windows Program, which is sandboxed to it's own folders within AppData, and cannot even read other files, much less write to them. My current difficulty is locating files (specifically, the settings file) within that sandbox in the first place.
For example, this line:
WCHAR* FileName2 = L"C:/Users/Dog/AppData/Local/Packages/Facebook.317180B0BB486_8xx8rvfyw5nnt/RoamingState/Settings.txt";
works fine with
std::ifstream settingsFile;
settingsFile.open(FileName2, std::ios::in ); //this reading is successful for hard-coded path
settingsFile.get(myChar);
settingsFile.close();
when facebook messenger is the active program, but this line does not:
WCHAR* FileName2 = L"ms-appdata:///roaming/Settings.txt";
Even though I can't hard code the path for every UserProfile and UWP directory.
Does anyone know what I could be doing wrong? I am using Visual Studio 2015 Community on Windows 10 and have a universal settings file for x86 and x64 EXEs, and I plan to write a service to copy that settings file to the RoamingState folder of each UWP whenever that file changes.