Click here to Skip to main content
15,918,596 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
Questiondownloader Pin
monsieur_jj11-May-08 17:06
monsieur_jj11-May-08 17:06 
AnswerRe: downloader Pin
Steve Echols11-May-08 19:55
Steve Echols11-May-08 19:55 
GeneralRe: downloader Pin
monsieur_jj11-May-08 20:02
monsieur_jj11-May-08 20:02 
GeneralRe: downloader Pin
Steve Echols11-May-08 20:20
Steve Echols11-May-08 20:20 
GeneralRe: downloader Pin
monsieur_jj11-May-08 22:15
monsieur_jj11-May-08 22:15 
GeneralRe: downloader Pin
Stuart Dootson12-May-08 22:12
professionalStuart Dootson12-May-08 22:12 
GeneralRe: downloader Pin
monsieur_jj13-May-08 17:27
monsieur_jj13-May-08 17:27 
GeneralRe: downloader Pin
Stuart Dootson13-May-08 22:31
professionalStuart Dootson13-May-08 22:31 
CHttpFile File1(Connection1,_T("GET"),_T("/"));
File1.SendRequest();
ULONGLONG const nBytes = </code><code>File1.GetLength();</code>
<code>BYTE* bytes = new BYTE[</code><code>nBytes</code><code>];
File1.Read(bytes ,</code><code>nBytes</code><code>) ;
HANDLE hFile = CreateFile(some-file-name, GENERIC_WRITE, 0, 0, CREATE_ALWAYS, 0, 0);
DWORD bytesWritten;
WriteFile(hFile, bytes, (DWORD)nBytes, &bytesWritten, 0);
CloseHandle(hFile);

I've assumed the file you're downloading is < 2GB (should be a safe assumption) and haven't put in any error handling. But that should work.



GeneralRe: downloader Pin
monsieur_jj13-May-08 22:50
monsieur_jj13-May-08 22:50 
GeneralRe: downloader Pin
monsieur_jj14-May-08 16:59
monsieur_jj14-May-08 16:59 
GeneralRe: downloader Pin
Stuart Dootson14-May-08 22:05
professionalStuart Dootson14-May-08 22:05 
GeneralRe: downloader Pin
monsieur_jj13-May-08 22:43
monsieur_jj13-May-08 22:43 
Questionhelp on exe generation by other exe Pin
alex7869-May-08 4:53
alex7869-May-08 4:53 
AnswerRe: help on exe generation by other exe Pin
Stuart Dootson12-May-08 22:27
professionalStuart Dootson12-May-08 22:27 
QuestionRead data from a serial port Pin
hari_honey8-May-08 20:58
hari_honey8-May-08 20:58 
QuestionRe: Read data from a serial port Pin
Cedric Moonen8-May-08 21:11
Cedric Moonen8-May-08 21:11 
AnswerRe: Read data from a serial port Pin
hari_honey8-May-08 21:46
hari_honey8-May-08 21:46 
GeneralRe: Read data from a serial port Pin
CPallini11-May-08 21:54
mveCPallini11-May-08 21:54 
QuestionMinimize button does not work on Vista with Aero (using PropertySheets) Pin
howard_khan18-May-08 6:37
howard_khan18-May-08 6:37 
Questionerror compling dll Pin
alex7867-May-08 3:47
alex7867-May-08 3:47 
AnswerRe: error compling dll Pin
Cedric Moonen8-May-08 21:10
Cedric Moonen8-May-08 21:10 
QuestionFunctionality similar to mcafee site advisor browser plugin Pin
bikramthapa7-May-08 2:18
bikramthapa7-May-08 2:18 
QuestionCatching a WM_MOUSEMOVE from a popup menu opened from IE-toolbar Pin
amosygal6-May-08 23:42
amosygal6-May-08 23:42 
QuestionFire Event from Worker thread in ATL COM Loaded on a Web Page Pin
garammasala5-May-08 23:52
garammasala5-May-08 23:52 
QuestionAtlAdvise returns 0x80040201 [modified] Pin
Scorp1us1-May-08 8:28
Scorp1us1-May-08 8:28 

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.