1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
char * laWorkingDirectory;
LPWSTR lwWorkingDirectory;
//get directory of type LPWSTR
GetCurrentDirectory(GetCurrentDirectory(0, NULL),
lwWorkingDirectory);
//convert to char *
WideCharToMultiByte(CP_ACP,
NULL,
lwWorkingDirectory,
-1,
laWorkingDirectory,
WideCharToMultiByte(CP_ACP, NULL, lwWorkingDirectory, -1, NULL, 0, NULL, NULL),
NULL,
NULL);
//convert to string
string lWorkingDirectory = string(laWorkingDirectory);
string lFileName = "";
//delete temp directories
delete [] lwWorkingDirectory, laWorkingDirectory;
|