2010/03/23
실행 파일의 경로 가져오기 _splitpath
TCHAR filename[MAX_PATH];
GetModuleFileName(NULL, filename, sizeof(filename));
TCHAR Drive[_MAX_DRIVE];
TCHAR Path[_MAX_DIR];
TCHAR Filename[_MAX_FNAME];
TCHAR Ext[_MAX_EXT];
_tsplitpath_s(filename, Drive, _MAX_DRIVE, Path, _MAX_DIR, Filename, _MAX_FNAME, Ext, _MAX_EXT);
MSDN 의 _splitpath 설명보기
void _splitpath(
const char *path,
char *drive,
char *dir,
char *fname,
char *ext
);
Parameters
path
Full path
drive
Optional drive letter, followed by a colon (:)
dir
Optional directory path, including trailing slash. Forward slashes ( / ),
backslashes ( \ ), or both may be used.
fname
Base filename (no extension)
ext
Optional filename extension, including leading period (.)
Remarks
The _splitpath function breaks a path into its four components. _splitpath automatically handles multibyte-character string arguments as appropriate, recognizing multibyte-character sequences according to the multibyte code page currently in use. _wsplitpath is a wide-character version of _splitpath; the arguments to _wsplitpath are wide-character strings. These functions behave identically otherwise
출처 : MSDN
Original Post : http://neodreamer-dev.tistory.com/387
Labels:
_splitpath
,
GetModuleFileName
,
TistoryOldPost
,
실행파일 경로
,
자신의 경로
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment