Possible Duplicates:
Win32: Find what directory the running process EXE is stored in
How to get the application executable name in Windows (C++ Win32 or C++/CLI)?
hi,
i want to make my application run on statup,it uses some of files in the same directory.it works good but when it start at startup the GetCurrentDirectory is “c:\Documents and Settings\User\”..but i want the actual path of the exe file.how i can get it in c++.
please help me.
thanks.
Try using
GetModuleFileNameorGetModuleFileNameEx.Do this:
Note I’m passing NULL as first argument, because MSDN says,
which is what you want. Right?