![]() |
||
| Home | SwiftForth Archive | SwiftX Archive | |

A "long" is a 32-bit value, returned in EAX, which sF returns as a single cell
on the stack. The contents of EAX (whatever it is -- long, pointer, boolean) is
the _only_ thing returned directly by any DLL call. More complex data (64-bit
values, strings, aggregate data types) would be returned in a memory structure
whose address you pass as a parameter when you call the function.
> -----Original Message-----
> From: sftalk-bounce_at_forth.com [mailto:sftalk-bounce_at_forth.com]On Behalf
> Of Robert Dickow
> Sent: Monday, December 09, 2002 4:36 PM
> To: sftalk_at_forth.com
> Subject: [sftalk] Re: LONGS returned from DLL call
>
>
>
> Since it seems like I typically get zero or little, it doesn't look like a
> pointer.
> The docs for the C template are from the freeware FTP4W ftp library. It
> shows a long returned, not a pointer to a long.
>
> I haven't ruled out that there is a bug in this library somewhere. For
> example,
> messages don't seem to be generated by FtpSendFile, while they do get
> generated from the FtpDir function, for example, which signals the message
> loop after each file name is read. However, putting FtpBytesTransferred in
> a busy loop doesn't seem to give valid values either.
>
> Let's not get too involved in this, as I am beginning to suspect a buggy
> freeware library here... the return of a long notwithstanding.
>
> Should sForth push 2 values on the stack in such cases?
>
> Bob
>
> \ *******************************************************
> \ FTP4W docs simply show: long FtpBytesTransferred(VOID)
>
> LIBRARY FTP4W32.DLL
>
> \ 1 IMPORT: RegisterWindowMessage
> 0 IMPORT: FtpBytesTransferred
>
> \ OUTBUFF = z$destination file
> \ INBUFF = z$localsourcefile
> \ MyFTPMessage, user "WM_MESSAGE"
> \ FtpSendFile, when the ftp4w is initialized
> \ for asynchronous mode, will send windows a
> \ message after sending a bunch of packets, this
> \ allows tracking the progress of ftp data
> \ transfers.
> OUTBUFF INBUFF TYPE_I 1 ( <- sendmsg flg ) hWND MyFTPMessage FtpSendFile if
> ...
>
> \ elsewhere, such as in windows message loop:
> FtpBytesTransferred ( .s ) \ --> depth = 1
> \ ...................
> \ clearly, since the bytes transferred would need to show
> \ valid values for large file transferes, should be a long
> \ value.
> ----- Original Message -----
> From: "Appert, Kevin" <kevin.appert_at_lmco.com>
>
> > >One of the routines returns a long double, but it only leaves 1 number on
> > the stack.
> > Is this a long double or a pointer to a long double being returned?
> > Could we see the code where you call the DLL?
> >
> > > -----Original Message-----
> > > I am using a 3rd party DLL in my forth program. One of the routines
> > > returns
> > > a long double, but it only leaves 1 number on the stack. How do I reach
> > > the
> > > other cell of the long returned value? I can't find this info. Thanks.
> > >
>
>
> ----------------------------------------------------------------------
> sftalk_at_forth.com The SwiftForth programming discussion email list
> To unsubscribe, send subject "unsubscribe sftalk" to listar_at_forth.com
> For help with listar commands, send subject "help" to listar_at_forth.com
> Archives are located at http://www.forth.com/sftalk -- check them out!
> Search the archives! Visit http://www.forth.com/search for details.
----------------------------------------------------------------------
sftalk_at_forth.com The SwiftForth programming discussion email list
To unsubscribe, send subject "unsubscribe sftalk" to listar_at_forth.com
For help with listar commands, send subject "help" to listar_at_forth.com
Archives are located at http://www.forth.com/sftalk -- check them out!
Search the archives! Visit http://www.forth.com/search for details.
Received on Mon Dec 09 2002 - 16:48:09 PST
This archive was generated by hypermail 2.2.0 : Tue Dec 02 2008 - 03:04:28 PST