WinInet progress bar

Jul 1, 2013 at 7:44pm
is there api for using a progress bar with wininet
Last edited on Jul 1, 2013 at 10:26pm
Jul 1, 2013 at 10:45pm
Microsoft provides the ProgressBar class.
It's up to you to update it as whatever you're doing progresses.
http://msdn.microsoft.com/en-us/library/system.windows.forms.progressbar.aspx?cs-save-lang=1&cs-lang=cpp#code-snippet-1
Jul 1, 2013 at 11:51pm
I familiar with the progress bar..such as setting the range and stepping it, but I know ReadFile and InternetWriteFile are needed to get the blocks of data, that is what I read on the internet.


can someone verify this though
Last edited on Jul 1, 2013 at 11:52pm
Jul 1, 2013 at 11:58pm
below /////
Last edited on Jul 2, 2013 at 9:28pm
Jul 2, 2013 at 4:38am
FtpPutFile is a blocking function, you can't use a progress bar with it, use InternetWriteFile instead.
http://msdn.microsoft.com/en-us/library/windows/desktop/aa385128(v=vs.85).aspx


However, if I were you, I'd use libcurl instead of WinInet:
http://curl.haxx.se/
Jul 2, 2013 at 9:30pm
Can someone tell me how this works. I was messing around with INTERNETWRITEFILE to upload but its not working..i just want to use internetwritefile to upload a simple text file(in FTP)..here is my code...

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
	HINTERNET remote = NULL;
	  DWORD dwBytesRead;
     DWORD dwBytesWritten;
	BYTE pBuffer[1024];
int row = m_listcontrol.GetSelectionMark();

CString s2 = m_listcontrol.GetItemText(row, 0); 

UpdateData(true);

CString piss;
piss = m_pep;
UpdateData(false);
MessageBox(piss,piss,MB_OK);

	 remote = FtpOpenFile(hIConnect,piss,GENERIC_READ,FTP_TRANSFER_TYPE_BINARY,NULL);
  InternetWriteFile(remote,pBuffer,35,&dwBytesWritten);
Last edited on Jul 2, 2013 at 9:36pm
Topic archived. No new replies allowed.