Hi, me an my friend are creating a program that requires locating files, which requires knowing the file path. We came across functions to find the user name of the current person logged into windows, and to find all the logical drives on the target computer. We need help passing the information gained from these functions into the findfile function . Here's our code:
Can't sprintf (or swprintf, or _stprintf) help you?
Besides, there are two (potential) problems in your code snippet:
The mixture of plain char/char* types and TCHAR/TCHAR*; so there may be problem in UNICODE build.
The folder names for user AppData and other special folders are local specific and OS-specific. Your example won't work on any non-english OS.
The correct way would be using SHGetFolderPath to obtain the correct folder path names.
Last edited by VictorN; January 16th, 2011 at 06:13 AM.
Bookmarks