The following answer gives a solution using C#, I was wondering what the equivalent would be if one were using only c++ (not c++\cli)
System.IO.Directory.SetCurrentDirectory(System.AppDomain.CurrentDomain.BaseDirectory);
Is there anything in boost that might do the trick?
Based on this problem I’ve been having: Correctly creating and running a win32 service with file I/O
SetCurrentDirectory(in Win32):http://msdn.microsoft.com/en-us/library/windows/desktop/aa365530%28v=vs.85%29.aspx
current_pathinboost::filesystem:http://www.boost.org/doc/libs/1_51_0/libs/filesystem/doc/reference.html#current_path
The equivalent for BaseDirectory might be
GetModuleFileName(with a null handle for the first argument), followed byGetFullPathNameto get the directory from the executable path.