char szBuffer[MAX_PATH];
char *pszRealDirEnd;
CString m_strCurrentDirectory;
GetModuleFileName( NULL, szBuffer, MAX_PATH ); // 현재 폴더의 경로를 얻어온다.
pszRealDirEnd = strrchr(szBuffer, '\\');
*pszRealDirEnd = '\0';
m_strCurrentDirectory = (CString)szBuffer;
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 );
#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 );
덧글을 달아 주세요