응용프로그램 경로 알기
Program/C | C++ 2008. 1. 16. 09:40 응용프로그램 포인터
AfxGetApp();
# 방법 1
theApp->GetConfig()->m_pPath;
# 방법 2
//실행파일까지 포함한 경로
CString string;
char filename[1024];
GetModuleFileName(NULL, filename, 1024);
string = filename;
# 응용프로그램 명
AfxGetAppName();
// 실행 파일명을 제외한 경로
int nIndex = string.ReverseFind('\\');
string = string.Left(nIndex);
AfxGetApp();
# 방법 1
theApp->GetConfig()->m_pPath;
# 방법 2
//실행파일까지 포함한 경로
CString string;
char filename[1024];
GetModuleFileName(NULL, filename, 1024);
string = filename;
# 응용프로그램 명
AfxGetAppName();
// 실행 파일명을 제외한 경로
int nIndex = string.ReverseFind('\\');
string = string.Left(nIndex);
'Program > C | C++' 카테고리의 다른 글
BSTR 형변환 (0) | 2008.01.16 |
---|---|
문자열에 대한 정리 (0) | 2008.01.16 |
CWaitCursor, GetTempFileName, LoadLibary, GetProcAdress (0) | 2008.01.16 |