Skip to main content
gamedev.net
🔒 Locked

WINDOWS: getting the current executing path

Started by zedzeek 2 replies 1.2k views
Original Post
zedzeek
zedzeek
i know theres _getcwd(..) but this return's the base directory eg if im running it from the msvc IDE, i want C:/APP/debug or C:/APP/release not C:/APP which _getcwd(..) returns thanks zed
KulSeran
KulSeran
c:/app in your case is the current execution path.

MSVC doesnt run the exe from the debug/release folder.
By default it runs it from the project folder.

Some other helpful poster prolly knows the command, but there is a way to
get the path to the exe that is being run.
LessBread
LessBread
GetModuleFileName

Note that HMODULE and HINSTANCE are the same thing, although with that function NULL will suffice for your purpose.
"I thought what I'd do was, I'd pretend I was one of those deaf-mutes." - the Laughing Man

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.