Hallo, Gerd! Hi, everybody!
(* Ich antworte mal nur ueber die Liste, damit alle etwas davon haben und ich nicht alles zweimal schreiben muss. :*)
I want to write some examples in gnu pascal but I have not enough experience in gnu pascal. I want test how powerful the actual version under Win32 is. So I would use some C - functions wellknown in the system.
You can use either the CygWin or the mingw32 port of GNU tools to Win32 - or you can use DJGPP or EMX in a DOS session. Which one are you using?
But I need a special type. A pointer of a function. How to do that? Or is that not implemented yet?
All versions of GPC I know support pointers to functions; recent beta versions also support references to functions (for BP compatibility).
Something like that:
type Pfunc = function( arglist: PVoid ): DWord;
This should work (provided that you support the types `PVoid' which is `Pointer' or `^Void' in GPC, and `DWord' is `Word' in GPC) and yields a *reference* to a function (just like BP). If you write
Type pFunc = ^Function ( ArgList: Pointer ): Word;
you define a pointer type to a function that gets a single untyped pointer as a value parameter and returns an unsigned 32-bit integer.
All pointers in GPC are 32-bit "near" pointers.
When using function from the Win32-API, you need to declare them `attribute ( stdcall )'.
Hope this helps,
Peter -- Peter Gerwinski, Essen, Germany, free physicist and programmer Maintainer GNU Pascal - http://home.pages.de/~GNU-Pascal/ - 1 Oct 1997 PGP key fingerprint: AC 6C 94 45 BE 28 A4 96 0E CC E9 12 47 25 82 75 Fight the SPAM! - http://maps.vix.com/