[fpc-pascal] Import Pascal record function to C
L505
fpc505 at z505.com
Tue Nov 1 01:25:33 CET 2005
>Yes, and the other way is also possible. This is done the other way
>round when a pascal program calls RegisterClass from the Windows API.
>It is sending a structure has a pointer to a function.
Thanks for the tip.
I think the structure that describes a procedure being used in a struct is here!
http://msdn.microsoft.com/library/en-us/winui/winui/windowsuserinterface/windowing/windowcla
sses/windowclassreference/windowclassstructures/wndclass.asp
>The only possible problem I see is if the structure contains numbers
>that are smaller then a Integer (smallint, byte, word, etc) ... then
>you may have some problems with the alignment of the data.
Yes I would be careful there... just use portable things like longint, bool, and etc.
instead of boolean and integer.
I'm just thinking in some cases, it is nice to have a record to offer some more organization
(organize like classes, but without object orientation features of course).
It seems records sure are a lot neater than Structs without the asterisks all over - gotta
love Pascal.
More information about the fpc-pascal
mailing list