Click here to Skip to main content
15,904,023 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: URLDownloadToFile, Cancel Button Pin
Chuck O'Toole18-Nov-11 17:25
Chuck O'Toole18-Nov-11 17:25 
GeneralRe: URLDownloadToFile, Cancel Button Pin
jkirkerx18-Nov-11 18:02
professionaljkirkerx18-Nov-11 18:02 
GeneralRe: URLDownloadToFile, Cancel Button Pin
enhzflep18-Nov-11 20:28
enhzflep18-Nov-11 20:28 
GeneralRe: URLDownloadToFile, Cancel Button Pin
jkirkerx19-Nov-11 7:15
professionaljkirkerx19-Nov-11 7:15 
GeneralRe: URLDownloadToFile, Cancel Button Pin
enhzflep19-Nov-11 15:00
enhzflep19-Nov-11 15:00 
GeneralRe: URLDownloadToFile, Cancel Button Pin
jkirkerx19-Nov-11 17:52
professionaljkirkerx19-Nov-11 17:52 
GeneralRe: URLDownloadToFile, Cancel Button Pin
enhzflep20-Nov-11 0:56
enhzflep20-Nov-11 0:56 
GeneralRe: URLDownloadToFile, Cancel Button Pin
jkirkerx20-Nov-11 18:06
professionaljkirkerx20-Nov-11 18:06 
Looks like the checksuming is a lot of work at this point.

I testing my code now, 742 meg download, and starting and stopping (Cancel). Strange, it picks up where it left off. I added a filesize check, to see if I have a partial or complete download before starting. If complete just install the file, that what the checksum was for, make sure it's legit.

I put that global in the callback h file, and cleaned up the h and cpp files for a class, so I suspect I can call it several times for concurrent use. I made the callback class global in the window code, so I call reference it from several different functions, and then release it at the end. All I need are more threads. I think I'll keep the downloads one at a time to get all the programs needed.

So far 554 megs, no stalls or freezes, progress bar looks accurate, percentage is correct.

No you were not a pain, I just had to much written already, and in theory, my code should work whether it was a dialog box or mdi child window, I didn't see the difference. I understood the last sample, just had to cherry pick what I needed.

What's your program for?. Commercial use?

I make web applications, and I've been waiting 8 years for a program that can install web applications with ease. Kind of like buying a bar-b-Que already build, having it delivered - with a bag of coals and matches. I tried very good instructions as a pdf, but the 1 click window app seems to be the way to go. I have a 99% failure rate on installation right now, so the goal is a single app packaged in installshield, in which it installs the window program, and sets up everything you need, and launches the browser window with the web code ready to go. Then add data import capability, like yahoo store, and an interface that sets your company info and preferences.

Download almost over, I need to stop and save a copy of a partial download so I don't have to keep downloading it.



Window Code:
SQL_Servers_BindCallback *callback;
HANDLE hThread;
long thread_id;

Function in Window Code:
callback = new SQL_Servers_BindCallback;
callback->m_MDIChild = hSQL_Servers_Download;
callback->m_Progress_Text = lbl_SQL_Server_Download_Status;
callback->m_Progress_Bar = pb_SQL_Server_Download_Status;

Class H:
#if !defined SQL_Servers_BindCallback_H
#define SQL_Servers_BindCallback_H

class SQL_Servers_BindCallback : public IBindStatusCallback
{

public:
SQL_Servers_BindCallback();
~SQL_Servers_BindCallback();

// Pointer to the download progress dialog.
LONG g_fAbortDownload;
HWND m_MDIChild;
HWND m_Progress_Text;
HWND m_Progress_Bar;

int iLoopCount;

// The time when the download should timeout.
BOOL m_bUseTimeout;
CTime m_timeToStop;

STDMETHOD(OnProgress)(
/* [in] */ ULONG ulProgress,
/* [in] */ ULONG ulProgressMax,
/* [in] */ ULONG ulStatusCode,
/* [in] */ LPCWSTR wszStatusText);
QuestionProblem with MSDN Preview Handler Recipe Pin
AndrewG123115-Nov-11 13:26
AndrewG123115-Nov-11 13:26 
QuestionOT - question for real COM / RS232 guru Pin
Vaclav_15-Nov-11 10:33
Vaclav_15-Nov-11 10:33 
AnswerRe: OT - question for real COM / RS232 guru Pin
Richard MacCutchan15-Nov-11 22:00
mveRichard MacCutchan15-Nov-11 22:00 
GeneralRe: OT - question for real COM / RS232 guru Pin
Vaclav_16-Nov-11 2:50
Vaclav_16-Nov-11 2:50 
GeneralRe: OT - question for real COM / RS232 guru Pin
Richard MacCutchan16-Nov-11 3:19
mveRichard MacCutchan16-Nov-11 3:19 
RantSmart pointers Pin
Pascal Ganaye15-Nov-11 6:15
Pascal Ganaye15-Nov-11 6:15 
GeneralRe: Smart pointers Pin
Erudite_Eric15-Nov-11 7:33
Erudite_Eric15-Nov-11 7:33 
GeneralRe: Smart pointers Pin
JackDingler15-Nov-11 11:23
JackDingler15-Nov-11 11:23 
GeneralRe: Smart pointers Pin
Stefan_Lang17-Nov-11 4:42
Stefan_Lang17-Nov-11 4:42 
GeneralRe: Smart pointers Pin
JackDingler17-Nov-11 5:48
JackDingler17-Nov-11 5:48 
GeneralRe: Smart pointers Pin
Stefan_Lang17-Nov-11 5:56
Stefan_Lang17-Nov-11 5:56 
GeneralRe: Smart pointers Pin
Orjan Westin15-Nov-11 23:41
professionalOrjan Westin15-Nov-11 23:41 
GeneralRe: Smart pointers Pin
Erudite_Eric16-Nov-11 22:39
Erudite_Eric16-Nov-11 22:39 
GeneralRe: Smart pointers Pin
Orjan Westin21-Nov-11 4:33
professionalOrjan Westin21-Nov-11 4:33 
GeneralRe: Smart pointers Pin
Erudite_Eric21-Nov-11 5:59
Erudite_Eric21-Nov-11 5:59 
GeneralRe: Smart pointers Pin
Orjan Westin21-Nov-11 7:38
professionalOrjan Westin21-Nov-11 7:38 
GeneralRe: Smart pointers Pin
Stefan_Lang17-Nov-11 4:58
Stefan_Lang17-Nov-11 4:58 

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.