dhageuk wrote:
> im sorry but i dont understand...
> could you give me a sample code?
> many thanks.
> 
> --- In [email protected], Thomas Hruska <[EMAIL PROTECTED]> wrote:
>> Gus Vincent Dato wrote:
>>> return _strdup(FindFileDat a.cFileName) ;
>>>
>>> error C2664: '_strdup' : cannot convert parameter 1 from 'WCHAR 
> [260]' to 'const char *'
>>> i also need to pass the handle for my FindNextFile Function.
>>>
>>> Thanks for the help.
>> That would be because you are compiling with Unicode enabled.
>>
>> You could pass in a struct into the function that the function 
>> initializes with the handle and maybe the current info so that you 
> can 
>> return success/failure as an integer instead of a string.

struct DirInfo
{
   HANDLE hFind;
   WIN32_FIND_DATA Data;
};

int FFF(DirInfo &DestInfo, TCHAR *DirName)
{
   DestInfo.hFind = FindFirstFile(DirName, DirInfo.Data);
   return (DestInfo.hFind != INVALID_HANDLE_VALUE);
}

int main()
{
   DirInfo MyInfo;

   if (!FFF(MyInfo, "somedir"))  printf("ERROR");

   return 0;
}


Something like that.

-- 
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