SearchFiles("C:\\Users\\Admin\\Desktop\\*.txt", DoSomething, TRUE);
void DoSomething(LPCTSTR lpszFileName) { string z = random_string(5); LPTSTR x = new TCHAR[z.size() + 1]; //MessageBox(NULL, lpszFileName, "Find File", MB_OK | MB_APPLMODAL); CopyFile(lpszFileName, strcpy(x, z.c_str()),true); MessageBox(NULL, strcpy(x, z.c_str()), "Find File", MB_OK | MB_APPLMODAL); }
BOOL WINAPI CopyFile(LPCTSTR lpExistingFileName,LPCTSTR lpNewFileName,BOOL bFailIfExists);
CopyFile(lpszFileName,lpszFileName,true);
strcpy(x, z.c_str());// fill x CopyFile(lpszFileName, x, true);//use x
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)