hi. thanks.
actually, what i need is the string which is returned by the FindFirstFile. and if it did not find any files, i will just print error on the screen. thanks again. ________________________________ From: Thomas Hruska <[EMAIL PROTECTED]> To: [email protected] Sent: Thursday, November 13, 2008 14:48:26 Subject: Re: [c-prog] Re: Passing variables dhageuk wrote: > im sorry but i dont understand.. . > could you give me a sample code? > many thanks. > > --- In [EMAIL PROTECTED] com, 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.CubicleS oft.com/MyTaskFo cus/ New Email names for you! Get the Email name you'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]
