현재 프로그램 경로

C++ 2012. 10. 5. 12:29


char bin_path[MAX_PATH] = {0};

GetModuleFileNameA(NULL, bin_path, MAX_PATH); //GetModuleFileName


std::string path = bin_path;

std::string::size_type pos = path.find_last_of("\\");

if (pos == std::string::npos) {

path = "";

} else {

path = path.substr(0, pos+1);

}

'C++' 카테고리의 다른 글

ip 목록 출력  (0) 2012.11.09
윈도우 서비스  (0) 2012.10.11
process kill 프로세스 죽이기  (0) 2012.10.10
pid 구하기  (0) 2012.10.10
for_each 와 boost bind  (0) 2012.09.07
FireBreath  (0) 2012.08.10
c++ logging library  (0) 2012.08.08
std::regex - 대충 이런 느낌  (0) 2012.08.01