[twsocket] ICS and FPC (Free Pascal)

Francois PIETTE francois.piette@pophost.eunet.be
Mon, 12 Jun 2000 17:21:35 +0200


> Some problems I can't directly think of an solution to get the units
> in VC32/ that don't use a type TForm to compile.

I'm busy implementing NOFORMS conditional compile to all components. I've
already done with TWSocket (as you know) and TFtpCli (just done, not yet
tested carefully. EMail me if you wants current source code).

> - (in most files)  (de)allocatehwnd(wndproc). What does this do?
> Set wndproc to be the tmessage handler?

(de)allocatehwnd procedure will create a hidden window to have a handle to
retrieve messages from message queue for the component, and assign wndproc
as message handler. It also does the required stuff to be able to use a
method (wndproc) as a message handling function (windows doesn't know
anything about methods, if only knowns about callback functions).

> Allocatehwnd could have the additional problem setting a method
> (instead of a procedure) as callback.

This problem is solved in TWSocket: Windows see XSocketWindowProc as the
windows callback function. XSocketWindowProc will call wndproc method after
retrieving the object reference from storage allocated in windows tructure
at window creation (see SetWindowLong and getWindowLong use in TWSocket
source code).


> - Ftpcli:  abort procedure/method is unknown. Is this just a decent
> halt?

In FtpCli, Abort is a component method, not Delphi Abort procedure. It close
the connection.

> - (known FPC bug) passing array of char or pchar to a method with
> ansistring as parameter doesn't work yet.

Use StrPas.

--
francois.piette@swing.be
http://users.swing.be/francois.piette/indexuk.htm


----- Original Message -----
From: Marco van de Voort <Marcov@stack.nl>
To: <twsocket@elists.org>
Sent: Sunday, June 11, 2000 9:34 PM
Subject: [twsocket] Re: TWSocket digest, Vol 1 #81 - 1 msg


>
>
> I seem to have been wrong, and FPC supports the message stuf,
> and probably will too on Linux someday. (development of FPC is so
> fast nowadays)
>
> I managed to get twsocket, twsockets, twsockbuf compiled without
> large problems:
> - cleaning up "uses" statements,
> - defining tmessage and pinteger
>
> I haven't tested yet, since I only guessed at the tmessage fields
> (from some older porting effort, since I'm at my parent's)
>
> Some problems I can't directly think of an solution to get the units
> in VC32/ that don't use a type TForm to compile.
> - (in most files)  (de)allocatehwnd(wndproc). What does this do?
> Set wndproc to be the tmessage handler?
> - ftpcli: application record doesn't seem to exist. (one or two other
> units too)
> - Ftpcli:  abort procedure/method is unknown. Is this just a decent
> halt?
> - ftpsrvc defines FonDisplay and OnDisplay while the parent from
> twsocket already defines it.
> - (known FPC bug) passing array of char or pchar to a method with
> ansistring as parameter doesn't work yet.
>
> Allocatehwnd could have the additional problem setting a method
> (instead of a procedure) as callback.
>
> I'll notify the rest of the FPC team of the problems, and probably
> the bugs will be fixed in the next weeks. Meanwhile, if somebody
> recognizes the problems, knows a workaround, or what they
> should do/how to implement, feel free to comment :-)
>
> I think with some work, the parts of ICS that don't use TForm can
> be get to run under FPC/win32 within weeks.
>
> P.s. One could probably remove 3-4 units from the average Uses
> line of a random unit in VC32 directory without breaking the
> program.
>
>
>
>
> _______________________________________________
> TWSocket mailing list [http://elists.org/mailman/listinfo/twsocket]
> Visit our website at http://www.rtfm.be/fpiette/indexuk.htm
>