Men får stadig fejlmeddeling ved "resume Demo" som fulgte med downloaden
komponenten.
[Hint] IEDownload.pas(334): Variable 'ResumeSupported' is declared but never
used in 'TBSCB.BeginningTransaction'
[Warning] IEDownload.pas(581): Combining signed and unsigned types - widened
both operands
[Warning] IEDownload.pas(581): Combining signed and unsigned types - widened
both operands
[Hint] IEDownload.pas(561): Variable 'temp' is declared but never used in
'TBSCB.OnProgress'
Det er ikke fejl. Det er hints og warnings. I lige netop dette tilfælde kan du ignorer dem. Som regel skal man dog sørge for at der ikke forekommer nogle warnings i det mindste.
De to hints indikere bare variabler som ikke bliver brugt.
De to warnings referer til en integer der tildeles en cardinal eller omvendt. Det kan give problemer, men gør det som regel ikke.
Integer: Signed 32-bit heltal. Den kan antage værdier imellem -2147483648 og 2147483647
Cardinal: Unsigned 32-bit helt. Den kan antage værdier imellem 0 og 4294967296.
--
Thomas Due
Software developer
udvikleren.dk - ASP redaktør
tdue@mail.dk
[Redigeret d. 03/01-04 00:56:37 af Thomas Due]
Hej
Kan alså ikke få IEDownload til at virke!
Det er DownloadDemo jeg prøver af.
Se kodeeksemplet om der noget der skal tilføjes eller andres.
Meddelse jeg får:
Memo1
Finding resource...
Connecting...
The server or proxy was not found. Unknown Response //hvad er dette?
Hele min Unit1:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, IEDownload, StdCtrls, UrlMon, wininet;
type
TForm1 = class(TForm)
IEDownload1: TIEDownload;
Button1: TButton;
Button2: TButton;
Memo1: TMemo;
Memo2: TMemo;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure IEDownload1Complete(Sender: TBSCB; Stream: TStream;
Result: HRESULT);
procedure IEDownload1Data(Sender: TBSCB; var Buffer: PByte;
var BufLength: Cardinal);
procedure IEDownload1Progress(Sender: TBSCB; ulProgress, ulProgressMax,
ulStatusCode: Cardinal; szStatusText: PWideChar; ElapsedTime, Speed,
EstimatedTime: String);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
Close;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
IEDownload1.PutFileName:='C:\\BookMap';
IEDownload1.go('http://www.sunwind.dk/designforum/downloadmap/murpro.zip');
end;
procedure TForm1.IEDownload1Complete(Sender: TBSCB; Stream: TStream;
Result: HRESULT);
begin
if (Result = S_OK) then
memo1.lines.add('Download complete...')
else
memo1.lines.add(Errortext(Result) + ' ' + ResponseCodeText(Sender.ResponseCode));
end;
procedure TForm1.IEDownload1Data(Sender: TBSCB; var Buffer: PByte;
var BufLength: Cardinal);
begin
memo2.lines.add(pchar(buffer));
end;
procedure TForm1.IEDownload1Progress(Sender: TBSCB; ulProgress,
ulProgressMax, ulStatusCode: Cardinal; szStatusText: PWideChar;
ElapsedTime, Speed, EstimatedTime: String);
var
s: string;
begin
s := BindstatusText(ulStatusCode);
if ulStatusCode = BINDSTATUS_DOWNLOADINGDATA then
s := S + ' (' + InttoStr(ulProgress) + '/' + InttoStr(ulProgressMax) + ')';
memo1.lines.add(s);
end;
end.
Det vil glæde mig meget at få dette til at virke!
Med venlig hilsen
Monie Jacobsen
energy@sunwind.dk