|
-
July 17th, 2003, 05:16 PM
#1
Getting full path to my application - How?
I want to put version information in my About box and an audit table in my db. To do this, I call GetFileVersionInfoSize(), which requires a full path to my exe. Surely there is a MFC or WinAPI call that will get me that info. Can someone point me to the call?
thanx
-
July 17th, 2003, 05:17 PM
#2
-
July 17th, 2003, 05:25 PM
#3
Here is the code u can use
char szAppPath[MAX_PATH] = "";
CString strAppDirectory;
::GetModuleFileName(0, szAppPath, sizeof(szAppPath) - 1);
// Extract directory
// Note, that the extra spaces around \\ are only for display //reasons here...
strAppDirectory = szAppPath;//AfxMessageBox(strAppDirectory );
strAppDirectory = strAppDirectory.Left(strAppDirectory.ReverseFind('\\'));
-
July 17th, 2003, 05:34 PM
#4
Thanx!
That was exactly what I needed!
-
July 17th, 2003, 05:38 PM
#5
MSDN says this about GetFileVersionInfoSize:
lptstrFilename [in] Pointer to a null-terminated string that specifies the name of the file of interest. The function uses the search sequence specified by the LoadLibrary function.
So you shouldn't need to specify the full path.
Regards,
Hal
-
July 17th, 2003, 05:54 PM
#6
A simple search through the FAQs would have been revealed this one...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|