See the question and my original answer on StackOverflow

Usually, people rewrite the Windows functions they need to be std::string friendly, like this:

std::string GetCurrentDirectoryA()
{
  char buffer[MAX_PATH];
  GetCurrentDirectoryA( MAX_PATH, buffer );
  return std::string(buffer);
}

or this for wide char support:

std::wstring GetCurrentDirectoryW()
{
  wchar_t buffer[MAX_PATH];
  GetCurrentDirectoryW( MAX_PATH, buffer );
  return std::wstring(buffer);
}