BOOL CopyFileEx(
LPCTSTR lpExistingFileName, // name of existing file
LPCTSTR lpNewFileName, // name of new file
LPPROGRESS_ROUTINE lpProgressRoutine, // callback function
LPVOID lpData, // callback parameter
LPBOOL pbCancel, // cancel status
DWORD dwCopyFlags // copy options
);
DWORD CALLBACK CopyProgressRoutine(
LARGE_INTEGER TotalFileSize, // file size
LARGE_INTEGER TotalBytesTransferred, // bytes transferred
LARGE_INTEGER StreamSize, // bytes in stream
LARGE_INTEGER StreamBytesTransferred, // bytes transferred for stream
DWORD dwStreamNumber, // current stream
DWORD dwCallbackReason, // callback reason
HANDLE hSourceFile, // handle to source file
HANDLE hDestinationFile, // handle to destination file
LPVOID lpData // from CopyFileEx
);
我怎么连CopyFileEx都不能用,我是WIN2000的,
还有我要实现复制文件显示进度,可以对其加以控制,怎么写?
LPCTSTR lpExistingFileName, // name of existing file
LPCTSTR lpNewFileName, // name of new file
LPPROGRESS_ROUTINE lpProgressRoutine, // callback function
LPVOID lpData, // callback parameter
LPBOOL pbCancel, // cancel status
DWORD dwCopyFlags // copy options
);
DWORD CALLBACK CopyProgressRoutine(
LARGE_INTEGER TotalFileSize, // file size
LARGE_INTEGER TotalBytesTransferred, // bytes transferred
LARGE_INTEGER StreamSize, // bytes in stream
LARGE_INTEGER StreamBytesTransferred, // bytes transferred for stream
DWORD dwStreamNumber, // current stream
DWORD dwCallbackReason, // callback reason
HANDLE hSourceFile, // handle to source file
HANDLE hDestinationFile, // handle to destination file
LPVOID lpData // from CopyFileEx
);
我怎么连CopyFileEx都不能用,我是WIN2000的,
还有我要实现复制文件显示进度,可以对其加以控制,怎么写?
error C2065: 'COPY_FILE_ALLOW_DECRYPTED_DESTINATION' : undeclared identifier要加什么头文件吗?
不够新吗?还是因为什么?不用包含头文件就行吗?
LARGE_INTEGER TotalFileSize, // file size
LARGE_INTEGER TotalBytesTransferred, // bytes transferred
LARGE_INTEGER StreamSize, // bytes in stream
LARGE_INTEGER StreamBytesTransferred, // bytes transferred for stream
DWORD dwStreamNumber, // current stream
DWORD dwCallbackReason, // callback reason
HANDLE hSourceFile, // handle to source file
HANDLE hDestinationFile, // handle to destination file
LPVOID lpData // from CopyFileEx
)
{
DWORD percent = TotalBytesTransferred*(100/TotalFileSize);//出错???????
return PROGRESS_CONTINUE;
}
void CA2EDlg::OnButtonStop()
{
CString str1;
CString str2;
str1="c:\\1\\1-1.wav";
str2="d:\\1-1.wav";
BOOL cancel=FALSE;
BOOL kkk=CopyFileEx(str1,str2,&MyCopyProgressRoutine,this,&cancel,COPY_FILE_RESTARTABLE);
if (kkk)
{
MessageBox("true");
}
else
MessageBox("false");
}
我想实现进度条,可是在回调函数里,类型转换出现问题,请指教?怎样实现进度条?
LARGE_INTEGER TotalFileSize, // file size
LARGE_INTEGER TotalBytesTransferred, // bytes transferred
LARGE_INTEGER StreamSize, // bytes in stream
LARGE_INTEGER StreamBytesTransferred, // bytes transferred for stream
DWORD dwStreamNumber, // current stream
DWORD dwCallbackReason, // callback reason
HANDLE hSourceFile, // handle to source file
HANDLE hDestinationFile, // handle to destination file
LPVOID lpData // from CopyFileEx
)
{
DWORD percent = TotalBytesTransferred*(100/TotalFileSize);//出错???????
return PROGRESS_CONTINUE;
}
void CA2EDlg::OnButtonStop()
{
CString str1;
CString str2;
str1="c:\\1\\1-1.wav";
str2="d:\\1-1.wav";
BOOL cancel=FALSE;
BOOL kkk=CopyFileEx(str1,str2,&MyCopyProgressRoutine,this,&cancel,COPY_FILE_RESTARTABLE);
if (kkk)
{
MessageBox("true");
}
else
MessageBox("false");
}
我想实现进度条,可是在回调函数里,类型转换出现问题,请指教?怎样实现进度条?