get directory my game is in?

Started by
4 comments, last by Kippesoep 18 years, 10 months ago
I cant figure it out, I just need to know what directory the executable is Im using devcpp/mingw under windows.
Advertisement
GetModuleFileName(NULL, etc.);
Awesome thanks very much
GetCurrentDirectory() also works. It'll return the absolute path to your exe.
Quote:Original post by JD
GetCurrentDirectory() also works. It'll return the absolute path to your exe.
not if your current working path changes subsequent to Win32 API usage
such as common file open/save dialogs.
"I am a donut! Ask not how many tris/batch, but rather how many batches/frame!" -- Matthias Wloka & Richard Huddy, (GDC, DirectX 9 Performance)

http://www.silvermace.com/ -- My personal website
Quote:Original post by silvermace
not if your current working path changes subsequent to Win32 API usage
such as common file open/save dialogs.


Or if you have a shortcut to the exe file that has the "start in" entry set to another directory than the exe is in.
Kippesoep

This topic is closed to new replies.

Advertisement