Skip to content

Commit

Permalink
local directory fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Rex109 committed Oct 2, 2021
1 parent a3488e0 commit 0187f50
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion iw3velometer/dllmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ std::stringstream str;

HANDLE process;

std::string DLLPath;

D3DDEVICE_CREATION_PARAMETERS cparams;
RECT screenrect;

Expand Down Expand Up @@ -149,7 +151,12 @@ bool initConfig()
CSimpleIniA ini;
ini.SetUnicode();

SI_Error rc = ini.LoadFile("iw3velometer.ini");
TCHAR Path[MAX_PATH] = { 0 };
GetModuleFileName(NULL, Path, MAX_PATH);
std::wstring::size_type pos = std::string(Path).find_last_of("\\/");
DLLPath = std::string(Path).substr(0, pos).append("\\iw3velometer.ini");

SI_Error rc = ini.LoadFile(DLLPath.c_str());
if (rc < 0)
return false;

Expand Down

0 comments on commit 0187f50

Please sign in to comment.