GetCurrentDirectoryThe GetCurrentDirectory function retrieves the current directory for the current process. DWORD GetCurrentDirectory( DWORD nBufferLength, LPTSTR lpBuffer );Parameters nBufferLength [in] Length of the buffer for the current directory string, in TCHARs. The buffer length must include room for a terminating null character. lpBuffer [out] Pointer to the buffer that receives the current directory string. This null-terminated string specifies the absolute path to the current directory.
DWORD GetCurrentDirectory(
DWORD nBufferLength,
LPTSTR lpBuffer
);Parameters
nBufferLength
[in] Length of the buffer for the current directory string, in TCHARs. The buffer length must include room for a terminating null character.
lpBuffer
[out] Pointer to the buffer that receives the current directory string. This null-terminated string specifies the absolute path to the current directory.
GetCurrentDirectory(128, szOrgPath); //取得当前的目录
就得到了,存在szOrgPath中了
pApp->m_curDir就是结果了
char szPath[MAX_PATH] = "";
GetCurrentDirectory(MAX_PATH,szPath);
2、
GetModuleFileName(MAX_PATH,szPath);
楼上都讲得那么清楚了,我就不重复什么了……
GetSystemDirectory//得到系统目录