Subject: Re: How to compile hello.pas for win32
You need to import the WinAPI functions before you can call them.
I knew this was necessary, but did not know the syntax - is it documented anywhere? I looked for it (honestly) but couldn't find it. I must admit I didn't look in the info database, because I assumed that this would be so win32 specific it wouldn't be there.
e.g., {$define WINAPI(X) asmname X; attribute(stdcall)}
FUNCTION GetModuleHandle ( lpModuleName : PChar ) : Integer; WINAPI ( 'GetModuleHandleA' );
Are you saying I can do c-style #defines in a pascal program using a syntax like this?
{$define macro definition}
Presumably these get fed through to the back-end c-preprocessor? Are there any other obscure "features" like this in GPC that I might need to know about?
ftp://agnes.dida.physik.uni-essen.de/home/chief/units.zip and extract wintypes.*, winprocs.* and messages.* from it. Put them in a directory that is accessible to the GPC compiler (preferably the 'units' subdirectory), and then you can do something like this;
program hello; uses messages, wintypes, winprocs; begin MessageBox (0, 'Hello World.', 'Greetings', mb_ok); end.
I will download these, and try again tonight.
You mean '-mno-cygwin'.
Yes I do mean -mno-cygwin (email typo, not a command line typo!)
BTW: if anyone is willing to help in completing work on these > >
units, then just drop me a line.
I will be in a position to help, once I have progressed from being a novice GPC user!
Many thanks for your help.
Mark.
-- Mark Taylor, Department of Corporate Information & Computing Services, Extension 21145. (0114) 222 1145 http://www.shef.ac.uk/misc/personal/ad1mt
The opinions expressed in this email are mine and not those of the University of Sheffield.