Get the folder of current application
-
Hello guys, Is there any API, which will return the full path of the folder from where my application is running ? Like
GetModuleFilename()
API , - but it returns the fullpath , including the filename. thanks
"Success is the ability to go from one failure to another with no loss of enthusiasm." - W.Churchill
-- modified at 15:24 Monday 24th October, 2005 -
Hello guys, Is there any API, which will return the full path of the folder from where my application is running ? Like
GetModuleFilename()
API , - but it returns the fullpath , including the filename. thanks
"Success is the ability to go from one failure to another with no loss of enthusiasm." - W.Churchill
-- modified at 15:24 Monday 24th October, 2005Hi You can extract Path easily, Like
GetModuleFileName(NULL,m_CurrentPath.GetBuffer(512),512); m_CurrentPath.ReleaseBuffer(); m_CurrentPath.Delete(m_CurrentPath.ReverseFind('\\'),m_CurrentPath.GetLength()-m_CurrentPath.ReverseFind('\\'));
Iman Ghasrfakhri -
Hi You can extract Path easily, Like
GetModuleFileName(NULL,m_CurrentPath.GetBuffer(512),512); m_CurrentPath.ReleaseBuffer(); m_CurrentPath.Delete(m_CurrentPath.ReverseFind('\\'),m_CurrentPath.GetLength()-m_CurrentPath.ReverseFind('\\'));
Iman Ghasrfakhri -
Ghasrfakhri wrote:
You can extract Path easily, Like
I know , but I am interested if there is a API function which will do this
"Success is the ability to go from one failure to another with no loss of enthusiasm." - W.Churchill
PathRemoveFileSpec Function Removes the trailing file name and backslash from a path, if it has them.
BOOL PathRemoveFileSpec(LPTSTR pszPath);
-
Hello guys, Is there any API, which will return the full path of the folder from where my application is running ? Like
GetModuleFilename()
API , - but it returns the fullpath , including the filename. thanks
"Success is the ability to go from one failure to another with no loss of enthusiasm." - W.Churchill
-- modified at 15:24 Monday 24th October, 2005Giorgi Moniava wrote:
Like GetModuleFilename() API , - but it returns the fullpath , including the filename.
Hi Giorgi, AFAIK, There is no such Api to Reterive Folder name only, you have to manually parse the FolderName ! :)
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta VC Forum Q&A :- I/ IV
-
Hello guys, Is there any API, which will return the full path of the folder from where my application is running ? Like
GetModuleFilename()
API , - but it returns the fullpath , including the filename. thanks
"Success is the ability to go from one failure to another with no loss of enthusiasm." - W.Churchill
-- modified at 15:24 Monday 24th October, 2005hi Giorgi Moniava Yeh alok is right as far as i know there is no such API availabe in VC6 thank you Vikas Amin Embin Technology Bombay vikas.amin@embin.com
-
Ghasrfakhri wrote:
You can extract Path easily, Like
I know , but I am interested if there is a API function which will do this
"Success is the ability to go from one failure to another with no loss of enthusiasm." - W.Churchill
as Blake Miller explained,
PathRemoveFileSpec()
exists for that but hey, look, it certainly does what one presented you before (with the reverse string search), and calling it will only slow your prgram down because of an added function call...
TOXCCT >>> GEII power
[toxcct][VisualCalc] -
as Blake Miller explained,
PathRemoveFileSpec()
exists for that but hey, look, it certainly does what one presented you before (with the reverse string search), and calling it will only slow your prgram down because of an added function call...
TOXCCT >>> GEII power
[toxcct][VisualCalc]toxcct wrote:
PathRemoveFileSpec() exists...and calling it will only slow your prgram down...
Slower compared to what?
"Take only what you need and leave the land as you found it." - Native American Proverb
-
toxcct wrote:
PathRemoveFileSpec() exists...and calling it will only slow your prgram down...
Slower compared to what?
"Take only what you need and leave the land as you found it." - Native American Proverb