Click here to Skip to main content
16,011,383 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Why use ???::??? Pin
Joseph Dempsey9-May-03 1:12
Joseph Dempsey9-May-03 1:12 
AnswerRe: Why use ???::??? Pin
Mike Dimmick9-May-03 6:21
Mike Dimmick9-May-03 6:21 
GeneralSend mail with SMTP Pin
Mazdak8-May-03 19:27
Mazdak8-May-03 19:27 
GeneralRe: Send mail with SMTP Pin
markkuk9-May-03 0:40
markkuk9-May-03 0:40 
GeneralRe: Send mail with SMTP Pin
Mazdak9-May-03 4:48
Mazdak9-May-03 4:48 
GeneralRe: Send mail with SMTP Pin
Anders Molin9-May-03 1:21
professionalAnders Molin9-May-03 1:21 
GeneralRe: Send mail with SMTP Pin
Mazdak9-May-03 4:48
Mazdak9-May-03 4:48 
GeneralAbout using CopyFileEx( ) Pin
charisma_youn8-May-03 18:01
charisma_youn8-May-03 18:01 
I have a problem on using CopyFileEx().

I want to let Progress-Bar progress by using CopyFileEx() to show progress of copying files.
But Progress-Bar is not created.
On Debugging, CopyProgressRoutine() is not called.

There are no problem on compiling and copying files.

Please advise...


*******************************************************************************************

*******************************************************************************************


// Declaration of CopyProgressRoutine() in header file
static DWORD CALLBACK CopyProgressRoutine( LARGE_INTEGER TotalFileSize,
LARGE_INTEGER TotalBytesTransferred,
LARGE_INTEGER StreamSize,
LARGE_INTEGER StreamBytesTransferred,
DWORD dwStreamNumber,
DWORD dwCallbackReason,
HANDLE hSourceFile,
HANDLE hDestinationFile,
LPVOID lpData );



*******************************************************************************************

*******************************************************************************************



// The part of using CopyFileEx() in source file
for (i = 0; i < tmpwd; i++)
{

sTmp3.Format("DepFile%d", i+1);
sTmp = sAppPath + "\\" + pApp->GetProfileString(sSection, sTmp3);
sTmp2 = sPrnDrvDir + sTmp.Mid(sTmp.ReverseFind('\\'));

CopyFileEx(sTmp, sTmp2, CopyProgressRoutine, NULL, &b_cancel, COPY_FILE_RESTARTABLE);
}


*******************************************************************************************

*******************************************************************************************


// Definition of CopyProgressRoutine()
DWORD CALLBACK CSetupDlg::CopyProgressRoutine( LARGE_INTEGER TotalFileSize,
LARGE_INTEGER TotalBytesTransferred,
LARGE_INTEGER StreamSize,
LARGE_INTEGER StreamBytesTransferred,
DWORD dwStreamNumber,
DWORD dwCallbackReason,
HANDLE hSourceFile,
HANDLE hDestinationFile,
LPVOID lpData )
{

AfxMessageBox("Is it called?");// MessageBox for knowing of CopyProgressRoutine() being called
// But MessageBox is not output.
// So CopyProgressRoutine() was not called.

CSetupDlg *pDlg = (CSetupDlg*)lpData;
pDlg->m_InstProgress.SetPos( (StreamBytesTransferred.QuadPart / pDlg->TotalSize) * 100 );
// pDlg->TotalSize : Total sizes of all files that will be copied;

return PROGRESS_CONTINUE;
}



GeneralRe: About using CopyFileEx( ) Pin
Neville Franks9-May-03 12:00
Neville Franks9-May-03 12:00 
GeneralINTERNAL COMPILER ERROR Pin
aguest8-May-03 15:29
aguest8-May-03 15:29 
GeneralRe: INTERNAL COMPILER ERROR Pin
Maxwell Chen8-May-03 16:39
Maxwell Chen8-May-03 16:39 
GeneralRe: INTERNAL COMPILER ERROR Pin
jhwurmbach9-May-03 2:05
jhwurmbach9-May-03 2:05 
GeneralRe: INTERNAL COMPILER ERROR Pin
Roger Allen9-May-03 2:20
Roger Allen9-May-03 2:20 
GeneralRe: INTERNAL COMPILER ERROR Pin
Erik Juhl9-May-03 5:25
Erik Juhl9-May-03 5:25 
QuestionCan a window Pin
RuchikaDhingra8-May-03 15:10
RuchikaDhingra8-May-03 15:10 
AnswerRe: Can a window Pin
John R. Shaw8-May-03 16:49
John R. Shaw8-May-03 16:49 
GeneralBackground thread Pin
basementman9-May-03 5:18
basementman9-May-03 5:18 
GeneralRe: Background thread Pin
RuchikaDhingra9-May-03 6:27
RuchikaDhingra9-May-03 6:27 
GeneralRe: Background thread Pin
John R. Shaw9-May-03 8:19
John R. Shaw9-May-03 8:19 
QuestionHow to launch application into background using ShellExecuteEx Pin
bluntagain8-May-03 14:10
bluntagain8-May-03 14:10 
AnswerRe: How to launch application into background using ShellExecuteEx Pin
John R. Shaw8-May-03 16:43
John R. Shaw8-May-03 16:43 
GeneralIE CDhtmlDialog PBm Pin
RaajaOfSelf8-May-03 13:05
RaajaOfSelf8-May-03 13:05 
GeneralRe: IE CDhtmlDialog PBm Pin
Joan M8-May-03 23:52
professionalJoan M8-May-03 23:52 
GeneralRe: IE CDhtmlDialog PBm Pin
RaajaOfSelf9-May-03 0:00
RaajaOfSelf9-May-03 0:00 
GeneralGDI+ OnPaint Pin
Hammerfall8-May-03 12:38
Hammerfall8-May-03 12:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.