progress bar almost working

Jul 4, 2013 at 3:29am
im close to getting this......the progress bar for wininet client ftp

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
int index;
         CString strText;
         index = m_dir.GetCurSel();

         m_dir.GetText(index,strText);
        

	
		 HINTERNET handle1 = FtpOpenFile(hIConnect,strText,GENERIC_READ,FTP_TRANSFER_TYPE_BINARY,0);
		DWORD filesized =  FtpGetFileSize(handle1,NULL);
		CString csNumber;
csNumber.Format("%lu", filesized);

MessageBox(csNumber,csNumber,MB_OK);
HANDLE hFile    = CreateFile(strText, GENERIC_WRITE, NULL, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
char Buffer[4024];
  DWORD dwRead =0;
 
  


m_yay.SetRange(0,filesized);
  while(InternetReadFile(handle1, Buffer, sizeof(Buffer), &dwRead) == TRUE)
  {
    if ( dwRead == 0) 
      break;
    DWORD dwWrite = 0;
	progress2 += dwRead;

	m_yay.SetPos(progress2);
    WriteFile(hFile, Buffer, dwRead, &dwWrite, NULL);
  }



can you helpme
Last edited on Jul 4, 2013 at 4:59am
Jul 4, 2013 at 3:40am
Jul 4, 2013 at 4:59am
bump....please read the first post

anyways.....


I added this instead of setpos

1
2
3
4

	m_yay.StepIt();
	


the progress bar goes crazy..it does not start from the beginngin..it fills all the waylike 1 million times....but it stops when the download is done...I need to to start from the beginning and increment real slow to the end.
Last edited on Jul 4, 2013 at 5:46am
Topic archived. No new replies allowed.