Q: How to get the current working directory?

A:



TCHAR szDirectory[MAX_PATH] = "";

if(!::GetCurrentDirectory(sizeof(szDirectory) - 1, szDirectory))
// Error -> call '::GetLastError()'