OK i learned how to get the app.path in vb and the the whole file path and name from c++ consol but i can i get it from Win32 c++
Printable View
OK i learned how to get the app.path in vb and the the whole file path and name from c++ consol but i can i get it from Win32 c++
GetCurrentDirectory() should take care of it.
Then you can manage the directory with PathCombine().
You cant guarentee that the current directory is the same as the application path. I believe that MSVC will change the current directory to the one the executable resides in when in Debug/Run mode, however, in the real world, dont bet on it.Quote:
Originally posted by made_of_asp
GetCurrentDirectory() should take care of it.
Then you can manage the directory with PathCombine().
Use GetModuleFilename(), and trim it backwards until you hit a '\\' character.
Z.
thanks alot . i would have thought it would have been complicate dbut you made it simple lol thanks again
TRUE. Current Directory can change, but I always use it anyway. You would have to modify your shortucts ""Working Directory" function.
Code:#include <shlwapi.h>
void Mod()
{
CHAR szModule[2048];
GetModuleFileName(GetModuleHandle(NULL), szModule, 2048);
::PathRemoveFileSpec(szModule);
MessageBox(NULL, szModule, "AAA", MB_OK);
}
MSVC++ sets the working directory in debug runs to the project main directory, which is not where the exe resides in.
Unlike VC# btw...
It is in my projects :DQuote:
Originally posted by CornedBee
MSVC++ sets the working directory in debug runs to the project main directory, which is not where the exe resides in.
Unlike VC# btw...
Z.
Well...