Hi all,i am using function COpyFile() to copy a file to windows directory,but the function return error code 5:
char win_path[MAX_PATH];
char reg[MAX_PATH];
GetModuleFileName(NULL , reg ,MAX_PATH);
GetWindowsDirectory(win_path , MAX_PATH);
bool x = CopyFile(reg , win_path , true);
if(!x)
cout << GetLastError() << endl;