Possible duplicate:How to get the application executable name in Windows (C ++ Win32 or C ++ / CLI)?
I can find the directory where this process is running using GetCurrentDirectory(), but what about searching the directory where executabke is located?
GetCurrentDirectory()
GetModuleFileNameor GetModuleFileNameEx.
GetModuleFileName
GetModuleFileNameEx
In Visual C ++, we use
CString m_sAppFolder = __targv[0] ;
which returns a string like "C: \ blah \ blah \ executable_name.exe"