Gus Vincent Dato wrote:
> somehow the code gets trashed. here it is:
>  
> char* FFF(TCHAR FilePath[MAX_PATH])
> {
>  WIN32_FIND_DATA FindFileData;
>  HANDLE hFind;
>  hFind = FindFirstFile(FilePath, &FindFileData);
>  if (hFind == INVALID_HANDLE_VALUE)
>   return _strdup("ERROR");
>  else {
>   return _strdup(FindFileData.cFileName);
>  }
> }

What are the errors?  You are also leaking a handle on every call to the 
function - you have to free handles (usually with the CloseHandle() API).

-- 
Thomas Hruska
CubicleSoft President
Ph: 517-803-4197

*NEW* MyTaskFocus 1.1
Get on task.  Stay on task.

http://www.CubicleSoft.com/MyTaskFocus/

Reply via email to