I guess I didn't notice that LPWIN32_FIND_DATAW is just a pointer. I was getting a warning that I looked at and just thought "of course its not initialized, it will get a value from FindFirstFile". So, I'll change that! This is for a Window Mobile device, so there is no C: drive, it is just \\. Then if you want a memory card, you would enter \\<<i>name of card> like mine is \\SD Card. I was searching for a file in a particular directory, but the file can have some parts slightly different, here is what I got working to find my file:
int GetTheFile(LPWSTR lpszDir)
{
LPWIN32_FIND_DATAW ac_file;
_WIN32_FIND_DATAW the_dir[MAX_PATH];
HANDLE fileHandle;
int ret=1;
ac\_file = the\_dir;
wsprintf(lpszDir, TEXT("\\\\My Documents\\\\first\*.txt"));
fileHandle = FindFirstFileW(lpszDir, ac\_file);
if (fileHandle != INVALID\_HANDLE\_VALUE)
For some reason I could not get the types to work correctly for making ac_file like you suggested, but I got it to work like this, and I can tinker with it now. This will look for a file in \My Documents named first.txt, like \My Document\first-1209.txt Thanks for helping me figure this out Dave :) . Ken