[태그:] 현재폴더


  • 현재 실행 경로 가져오기

    자주 쓰는 기능인데 할때 마다 예전에 만든 소스 찾는거 귀찮아서 여기에 정리한다. wchar_t CurrentTempDIR[_MAX_PATH]; GetModuleFileNameW(NULL,CurrentTempDIR,_MAX_PATH); std::wstring strCurrentPath = CurrentTempDIR; std::wstring::size_type tmpPost; tmpPost =strCurrentPath.rfind(L”\\”,strCurrentPath.size()); strCurrentPath = strCurrentPath.substr(0, tmpPost); 이건 유니코드 버전 char CurrentTempDIR[_MAX_PATH]; GetModuleFileNameA(NULL,CurrentTempDIR,_MAX_PATH); std::string strCurrentPath = CurrentTempDIR; std::string::size_type tmpPost; tmpPost… “read more”