PathRemoveFileSpec 함수 사용을 위해서는 아래 두 줄을 추가해야 한다.
#include <Shlwapi.h>
#pragma comment( lib, "shlwapi.lib" )
<코드>
const int N_BUF_SIZE = 1024;
TCHAR tcPath[N_BUF_SIZE] = {0, };
GetModuleFileName( NULL, tcPath, N_BUF_SIZE );
-> tcPath == E:\KOW\branches\Release\ErrorController.exe
PathRemoveFileSpec( tcPath );
-> tcPath == E:\KOW\branches\Release
PathRemoveFileSpec( tcPath );
-> tcPath == E:\KOW\branches
#include <Shlwapi.h>
#pragma comment( lib, "shlwapi.lib" )
<코드>
const int N_BUF_SIZE = 1024;
TCHAR tcPath[N_BUF_SIZE] = {0, };
GetModuleFileName( NULL, tcPath, N_BUF_SIZE );
-> tcPath == E:\KOW\branches\Release\ErrorController.exe
PathRemoveFileSpec( tcPath );
-> tcPath == E:\KOW\branches\Release
PathRemoveFileSpec( tcPath );
-> tcPath == E:\KOW\branches