Click here to Skip to main content
15,909,324 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: When resizing, some child control doesn't show correctly until I put the mouse curson on it Pin
Naveen6-May-08 17:34
Naveen6-May-08 17:34 
GeneralRe: When resizing, some child control doesn't show correctly until I put the mouse curson on it Pin
followait6-May-08 23:02
followait6-May-08 23:02 
Questionhttp download question Pin
monsieur_jj6-May-08 16:28
monsieur_jj6-May-08 16:28 
AnswerRe: http download question Pin
Randor 6-May-08 16:46
professional Randor 6-May-08 16:46 
GeneralRe: http download question Pin
monsieur_jj6-May-08 16:57
monsieur_jj6-May-08 16:57 
GeneralRe: http download question Pin
Randor 6-May-08 17:16
professional Randor 6-May-08 17:16 
GeneralRe: http download question Pin
monsieur_jj6-May-08 21:20
monsieur_jj6-May-08 21:20 
GeneralRe: http download question Pin
Randor 7-May-08 4:01
professional Randor 7-May-08 4:01 
Hello!

Its very difficult to debug your code remotely. To better format your code postings in the future I would recommend wrapping the text in the CODE then the PRE tags. Makes it much easier to read when its formatted correctly.

If your goal is to simply download a remote file then perhaps you can use CInternetSession[^] rather than the WinInet classes.

Here is a sample of how to read a remote file over HTTP and write it locally. Much easier!

I pulled this code snippit from an old project. It was inside a CWinThread derived class for multi-threaded downloads.

char httpbuff[512];
CInternetSession Session;
CStdioFile *remotefile = Session.OpenURL(_T("http://www.somewhere.com/somepath/somefile.zip") ,1,INTERNET_FLAG_TRANSFER_BINARY | INTERNET_FLAG_RELOAD);
CFile myfile(_T("\\Path\\To\\Somewhere\\Local"), CFile::modeCreate|CFile::modeWrite|CFile::typeBinary);
int iBytes;
while (iBytes = remotefile->Read(httpbuff, 512))
{
	myfile.Write(httpbuff, iBytes);
}


If you also need the filesize for a progress bar then you can use CHttpFile::QueryInfo() to get that information. CHttpConnection::OpenRequest() returns CHttpFile.

Best Wishes,
-David Delaune
GeneralRe: http download question Pin
monsieur_jj7-May-08 15:23
monsieur_jj7-May-08 15:23 
Questionsomething wrong when use createservice Pin
abruzzi6-May-08 14:48
abruzzi6-May-08 14:48 
AnswerRe: something wrong when use createservice Pin
Randor 6-May-08 15:25
professional Randor 6-May-08 15:25 
GeneralRe: something wrong when use createservice Pin
abruzzi6-May-08 15:34
abruzzi6-May-08 15:34 
GeneralRe: something wrong when use createservice Pin
Randor 6-May-08 15:55
professional Randor 6-May-08 15:55 
GeneralRe: something wrong when use createservice Pin
abruzzi6-May-08 16:33
abruzzi6-May-08 16:33 
GeneralRe: something wrong when use createservice Pin
Randor 6-May-08 16:58
professional Randor 6-May-08 16:58 
GeneralRe: something wrong when use createservice Pin
JudyL_MD7-May-08 3:02
JudyL_MD7-May-08 3:02 
QuestionCan I use a local Bitmap object constructor a global CachedBitmap object? Pin
followait6-May-08 14:08
followait6-May-08 14:08 
AnswerRe: Can I use a local Bitmap object constructor a global CachedBitmap object? Pin
Randor 6-May-08 15:21
professional Randor 6-May-08 15:21 
AnswerRe: Can I use a local Bitmap object constructor a global CachedBitmap object? Pin
Saurabh.Garg6-May-08 15:27
Saurabh.Garg6-May-08 15:27 
Questionrestore data to edit box when double click a file Pin
lahom6-May-08 13:46
lahom6-May-08 13:46 
AnswerRe: restore data to edit box when double click a file Pin
Hamid_RT6-May-08 17:25
Hamid_RT6-May-08 17:25 
AnswerRe: restore data to edit box when double click a file Pin
dehseth6-May-08 19:59
dehseth6-May-08 19:59 
GeneralRe: restore data to edit box when double click a file Pin
lahom7-May-08 2:23
lahom7-May-08 2:23 
GeneralRe: restore data to edit box when double click a file Pin
lahom8-May-08 17:13
lahom8-May-08 17:13 
AnswerRe: restore data to edit box when double click a file Pin
Nitheesh George6-May-08 23:13
Nitheesh George6-May-08 23:13 

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.