GetModuleFileName是获得程序当前的运行目录
GetCurrentDirectory获取当前进程所有在的目录
复制代码
- CFileDialog fdlg(true);
- fdlg.DoModal();//////
- TCHAR *pBuffer = new TCHAR[1024];
- ZeroMemory(pBuffer, 1024);
- GetCurrentDirectory(1024, pBuffer);
- MessageBox(pBuffer, L"GetCurrentDirectory");
- ZeroMemory(pBuffer, 1024);
- GetModuleFileName(NULL, pBuffer, 1024);
- MessageBox(pBuffer, L"GetModuleFileName");
|