Moving file with progress
-
hi am looking to move the existing file along with progress control update . i tried with movefilewithprogrees did not work . canany body explain the concept
movefilewithprogrees
how it work or any alternate way for moving the file with progress update . this movefilewithprogress will move the file if i get how much this function will transfer the data . Best Regards sarfaraz
-
hi am looking to move the existing file along with progress control update . i tried with movefilewithprogrees did not work . canany body explain the concept
movefilewithprogrees
how it work or any alternate way for moving the file with progress update . this movefilewithprogress will move the file if i get how much this function will transfer the data . Best Regards sarfaraz
-
hi am looking to move the existing file along with progress control update . i tried with movefilewithprogrees did not work . canany body explain the concept
movefilewithprogrees
how it work or any alternate way for moving the file with progress update . this movefilewithprogress will move the file if i get how much this function will transfer the data . Best Regards sarfaraz
sarfaraznawaz wrote:
i tried with movefilewithprogrees did not work .
You need to explain what it was that did not work, we cannot guess. Have you checked the documentation[^] to ensure that your function call is correct and also checked for any error responses?
One of these days I'm going to think of a really clever signature.
-
hi am looking to move the existing file along with progress control update . i tried with movefilewithprogrees did not work . canany body explain the concept
movefilewithprogrees
how it work or any alternate way for moving the file with progress update . this movefilewithprogress will move the file if i get how much this function will transfer the data . Best Regards sarfaraz
sarfaraznawaz wrote:
i tried with movefilewithprogrees did not work .
Which is all but totally meaningless without showing how you are using that function, and what
GetLastError()
is returning. We're not mind readers!"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
-
sarfaraznawaz wrote:
i tried with movefilewithprogrees did not work .
Which is all but totally meaningless without showing how you are using that function, and what
GetLastError()
is returning. We're not mind readers!"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
see i tried like this but it does not coming in callback function . so that i use while loop to update the progress
<pre>DWORD CALLBACK CopyProgressRoutine(LARGE_INTEGER TotalFileSize,LARGE_INTEGER TotalBytesTransferred,LARGE_INTEGER StreamSize,
LARGE_INTEGER StreamBytesTransferred,DWORD dwStreamNumber,DWORD dwCallbackReason,
HANDLE hStoreFile,HANDLE hFinalFile,LPVOID lpData)
{Temp\_TotalBytesTransferred.QuadPart = TotalBytesTransferred.QuadPart; Temp\_TotalFileSize.QuadPart=TotalFileSize.QuadPart; iNewPercent1 = int(( double(TotalBytesTransferred.QuadPart) / double(TotalFileSize.QuadPart) ) \* 100); return PROGRESS\_CONTINUE;
}</pre><pre lang="cs">while(savingbytetraversed<=m_li64FileSize.QuadPart)
{::SendMessage(h\_wnd,WM\_APP + 12, 0,0); savingbytetraversed+=10; ullBytesTraversed = savingbytetraversed; if (bSaveexecution == 0) { successForsavingfile == FALSE; break; } } if (savingbytetraversed >= m\_li64FileSize.QuadPart ) { successForsavingfile =TRUE; ::SendMessage(h\_wnd,WM\_APP + 12, 0,0); MoveFileWithProgress(FilePathForSaving,pathforsaving, CopyProgressRoutine, NULL, MOVEFILE\_COPY\_ALLOWED); ::MessageBox(h\_wnd,\_T("File Saved successfully "),\_T("Information "),MB\_ICONINFORMATION); successForsavingfile = FALSE; closefile= FALSE; }</pre>
-
see i tried like this but it does not coming in callback function . so that i use while loop to update the progress
<pre>DWORD CALLBACK CopyProgressRoutine(LARGE_INTEGER TotalFileSize,LARGE_INTEGER TotalBytesTransferred,LARGE_INTEGER StreamSize,
LARGE_INTEGER StreamBytesTransferred,DWORD dwStreamNumber,DWORD dwCallbackReason,
HANDLE hStoreFile,HANDLE hFinalFile,LPVOID lpData)
{Temp\_TotalBytesTransferred.QuadPart = TotalBytesTransferred.QuadPart; Temp\_TotalFileSize.QuadPart=TotalFileSize.QuadPart; iNewPercent1 = int(( double(TotalBytesTransferred.QuadPart) / double(TotalFileSize.QuadPart) ) \* 100); return PROGRESS\_CONTINUE;
}</pre><pre lang="cs">while(savingbytetraversed<=m_li64FileSize.QuadPart)
{::SendMessage(h\_wnd,WM\_APP + 12, 0,0); savingbytetraversed+=10; ullBytesTraversed = savingbytetraversed; if (bSaveexecution == 0) { successForsavingfile == FALSE; break; } } if (savingbytetraversed >= m\_li64FileSize.QuadPart ) { successForsavingfile =TRUE; ::SendMessage(h\_wnd,WM\_APP + 12, 0,0); MoveFileWithProgress(FilePathForSaving,pathforsaving, CopyProgressRoutine, NULL, MOVEFILE\_COPY\_ALLOWED); ::MessageBox(h\_wnd,\_T("File Saved successfully "),\_T("Information "),MB\_ICONINFORMATION); successForsavingfile = FALSE; closefile= FALSE; }</pre>
You're calling
MoveFileWithProgress()
from within the callback function?"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous