char szBuffer[MAX_PATH];
char *pszRealDirEnd;
CString m_strCurrentDirectory;

GetModuleFileName( NULL, szBuffer, MAX_PATH ); // 현재 폴더의 경로를 얻어온다.
pszRealDirEnd = strrchr(szBuffer, '\\');
*pszRealDirEnd = '\0';
m_strCurrentDirectory = (CString)szBuffer; 

#include <tchar.h>
#include <strsafe.h>

// 실행파일 이름을 가져온다.

TCHAR szAppPath[ MAX_PATH ] = {0};
TCHAR szAppName[ MAX_PATH ] = {0};
 
if( GetModuleFileName( NULL, szAppPath, _countof( szAppPath ) ) )
{
  TCHAR *pszReadDirEnd = _tcsrchr( szAppPath, _T('\\') );
  if( pszReadDirEnd != NULL )
  {
   StringCchCopy( szAppName, _countof( szAppName ), pszReadDirEnd + 1 );
    *pszReadDirEnd = _T('\0');
  }
}
 
OutputDebugStr( szAppPath );
OutputDebugStr( szAppName );
 
2006/05/13 23:28 2006/05/13 23:28

글 걸기 주소 : 이 글에는 트랙백을 보낼 수 없습니다

덧글을 달아 주세요