cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Progress function

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 8 Apr 2002 08:38:12 +0200 (MET DST)

On Mon, 8 Apr 2002, Aldo Armiento wrote:

> I'm using libcurl under Windows with Borland Delphi 5.

Hold your horses, how do you do that? Are you using the CurlPas binding for
that or how did you get this working for Delphi? I wasn't aware anyone had
made this...! :-)

> All ok, but progress function don't work.
> The function is called by libcurl and if I set the result <> 0 the libcurl,
> rightly, exit with error.
>
> The problem is that parms contain random values. I don't understund it
> because I use another callback, WRITEFUNCTION and with this is ALL OK. This
> callbacks are called by libcurl in different ways?

Yes, they're called in different ways. I corrected the prototype just before
7.9.5 was released. Check the curl/curl.h header file again:

> and this work OK, this is, instead, ProgressFunction
>
> function Prova(p:pointer; dltotal, dlnow, ultotal, ulnow: longint): longint;
> stdcall;
> begin
> Prova := 0;
> end;

Now I'm not a Delphi hacker, but "longint" certainly sounds wrong since the
four arguments after the pointer are of the type 'double' in the C code. I
believe this is the reason for your problem.

> P.S. I'm using libcurl under linux and with PHP and I'm very happy so I
> decided to use it with Windows...

:-)

-- 
    Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/
Received on 2002-04-08