There are at least 3 options without complicated configurations.
1 - From your calling application change current directory to where your test.exe
program is located. That way, files will go to the desired directory. BUT then it is possible that the calling application will have problems or generate output where it should not, so a new change of current directory in the calling application is needed
2 - Pass as parameter to your test.exe
where it should generate its files.
3 - Determine from your test.exe
where it is located and use this information to change current directory for this process, or, knowing the path, generate the files in the same directory it is located.
TCHAR szPath[MAX_PATH];
if( !GetModuleFileName( NULL, szPath, MAX_PATH ) ) {
// handle error in GetModuleFileName
} else {
// now, szPath contains file path
};
This is the standard windows way of retrieving the location of the current process. Reference here: GetModuleFileName