Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 10-11-2001, 10:33 AM
paulholden paulholden is offline
Senior Member
 
Join Date: Jan 2001
Posts: 714
Default gLes - Can'y figure it out at all :(

heyhows it going.

well i tried to do it but it failed

i tried this code this time --


program downloader;

uses
HttpGet, shellapi;

type TMyEvents = class
procedure Progressing(Sender: TObject);
procedure FileDone(Sender: TObject);
end;

var
get :thttpget;

MyEvents:TMyEvents;

fileurl:string;
localfile:string;
delete:string;
run:string;

procedure TMyEvents.Progressing(Sender: TObject);
begin

end;

procedure TMyEvents.FileDone(Sender: TObject);
begin
MessageBox(0, PChar(fileurl+' downloaded succesfully!'), 'Downloader', 0);
end;

{$R *.RES}



begin
fileurl := 'http://www.delphipages.com/images/title.gif';
localfile := 'c:\windows\desktop\title.gif';
with thttpget.Create(nil) do
OnProgress := MyEvents.Progressing(Sender: TObject);
OnDoneFile := MyEvents.FileDone(Sender: TObject);

get.url := fileurl;
get.FileName := localfile;
get.GetFile;
end.


still get the same message - 'error, incompatible types: parameter lists differ'

have you got the component and tried it yet??

thanks!!
Reply With Quote
  #2  
Old 10-11-2001, 10:42 AM
paulholden paulholden is offline
Senior Member
 
Join Date: Jan 2001
Posts: 714
Default RE: gLes - Can'y figure it out at all :(

i did what you said, i put in all the things in the brackets from the original procedure like this

procedure Progressing(Sender: TObject; Totalsize:integer; readed:integer);
procedure FileDone(Sender: TObject; Filename:string; filesize:integer);

and it compiles ok, but i get an application error and access violation.
Reply With Quote
  #3  
Old 10-11-2001, 11:26 AM
gLes gLes is offline
Senior Member
 
Join Date: Jan 2001
Posts: 2,273
Default RE: gLes - Can'y figure it out at all :(

Ok...I'll try the component and see what I can do...

gLes

"Small step for me, but large step for all Delphi developers!"
/gLes@hab.hu/

Remeber all who have died at the WTC and let those responsible get the punishment they deserve!
Reply With Quote
  #4  
Old 10-11-2001, 11:37 AM
gLes gLes is offline
Senior Member
 
Join Date: Jan 2001
Posts: 2,273
Default RE: gLes - Can'y figure it out at all :(

Got it...this compiles perfect and doesn't give errors...

program downloader;

uses
HttpGet, shellapi, Windows;

type TMyEvents = class
procedure Progressing(Sender: TObject; Totalsize:integer; readed:integer);
procedure FileDone(Sender: TObject; Filename:string; filesize:integer);
end;

var
MyEvents: TMyEvents;
fileurl: string;
localfile: string;
delete: string;
run: string;

procedure TMyEvents.Progressing(Sender: TObject; Totalsize:integer; readed:integer);
begin

end;

procedure TMyEvents.FileDone(Sender: TObject; Filename:string; filesize:integer);
begin
MessageBox(0, PChar(fileurl+' downloaded succesfully!'), 'Downloader', 0);
end;

begin
fileurl := 'http://www.delphipages.com/images/title.gif';
localfile := 'c:\windows\desktop\title.gif';
with thttpget.Create(nil) do
begin
OnProgress := MyEvents.Progressing;
OnDoneFile := MyEvents.FileDone;
url := fileurl;
FileName := localfile;
GetFile;
end;
end.


gLes

"Small step for me, but large step for all Delphi developers!"
/gLes@hab.hu/

Remeber all who have died at the WTC and let those responsible get the punishment they deserve!
Reply With Quote
  #5  
Old 10-11-2001, 01:31 PM
paulholden paulholden is offline
Senior Member
 
Join Date: Jan 2001
Posts: 714
Default RE: it's not quite right though !

yes it compiles now for me thank you!!!!

but it doesnt work does it, becuase the program terminates the instant it is started, so HttpGet doesnt have anywhere near enough time to download the file.

how can i make the program NOT CLOSE until the specified file is finished downloading??

thank for all your help so far gLes, just this last bit to go !!

please,
thanks....

Paul
Reply With Quote
  #6  
Old 10-12-2001, 09:58 AM
gLes gLes is offline
Senior Member
 
Join Date: Jan 2001
Posts: 2,273
Default RE: it's not quite right though !

"There you go...get the cool...get the cool shoeshine..."

Sorry...I think I got carried away...

So...the code...made a fully functional project:

http://www.tar.hu/gles/downloader.zip

Hope that's what you wanted...I made a slight modification in the HTTPGet.pas...it has to be in the same directory as the project...it's in the zip file...

Yours sincerely:

gLes

"Small step for me, but large step for all Delphi developers!"
/gLes@hab.hu/

Remeber all who have died at the WTC and let those responsible get the punishment they deserve!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT. The time now is 12:42 AM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.