hey everyone, i was wondering if anyone can tell me how to prompt the user the enter the filename to be searched for using FindFirstFile. and if there a way of setting a default path to search in
darkdai -1 Light Poster
Recommended Answers
Jump to PostIf you enter *.* from the keyboard then just concantinate the two strings. Simple.
char path[255] = {"c:\\myfolder\\}; char file[] = "*.*'; strcat(path,file); FindFirstFile(path, ...);
Jump to PostYou are compiling for UNICODE. Either turn UNICODE off or make the string literals UNCODE compatible.
#include <tchar.h> ... <snip> TCHAR path[260]={_TEXT("C:\\Users\\")}; TCHAR filename[30]=_TEXT("*.*"); _tcscat(path,filename); hFind = FindFirstFile(path, &FindFileData);
All 5 Replies
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague
darkdai -1 Light Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
darkdai -1 Light Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.