Get path
#Case 1
char reDir[500]; ::GetCurrentDirectory(500,reDir); ::AfxMessageBox(reDir);
#Case 2
TCHAR buff[MAX_PATH]; memset(buff, 0, MAX_PATH); ::GetCurrentDirectory(MAX_PATH, buff); CString strFolder = buff;
Get path & module nameTCHAR buff[MAX_PATH];
memset(buff, 0, MAX_PATH);
::GetModuleFileName(NULL,buff,sizeof(buff));
CString strFolder = buff;
strFolder = strFolder.Left(strFolder.ReverseFind(_T('\\'))+1);
No comments:
Post a Comment