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.





________________________________
From: Thomas Hruska <[EMAIL PROTECTED]>
To: [email protected]
Sent: Wednesday, November 12, 2008 21:41:35
Subject: Re: [c-prog] Passing variables


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(FindFileDat a.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.CubicleS oft.com/MyTaskFo cus/

 


      New Email names for you! 
Get the Email name you&#39;ve always wanted on the new @ymail and @rocketmail. 
Hurry before someone else does!
http://mail.promotions.yahoo.com/newdomains/aa/

[Non-text portions of this message have been removed]

Reply via email to