How can I get the full path name of my application at runtime???
Printable View
How can I get the full path name of my application at runtime???
See GetModuleFileName() in the docs.
You can also use GetCommandLine() to get the full path for your app.
Hi.
I use this procedure:
UINT GetBaseDirectory(LPTSTR lpBuffer, UINT uSize)
{
if(lpBuffer==NULL) {ASSERT(0); return 0;}
DWORD resLen = GetModuleFileName(NULL, lpBuffer, uSize);
if(resLen==0) {ASSERT(0); return 0;}
//exclude file name
do
resLen--;
while(lpBuffer[resLen-1]!='\\');
lpBuffer[resLen] = 0;
return resLen;
}
Best wishes.