[fpc-pascal]Resource files & FreePascal
Joris Vankerschaver
Joris.Vankerschaver at rug.ac.be
Mon Apr 8 23:12:28 CEST 2002
Hi,
I'm experiencing a bit of trouble compiling resource files with
Windres & FreePascal. Although I realize that this is not a
FreePascal related question as such, I do think that some of
the members here might be able to help me.
Apparently, I can't declare constants in my resource file, that
are later resolved by the pascal preprocessor. My own units
are fine (eg. the unit that contains the menuitem IDs), but I
can't refer to Windows.pp (even if I copy it into my project
directory).
The only way out is to copy the actual values directly in my
resource file - not an elegant solution.
Secondly, are there any quirks with windres I should be aware
of? The following code comes from Petzold's Programming Windows 95:
AboutBox DIALOG 20, 20, 160, 80
STYLE WS_POPUP | WS_DLGFRAME
{
CTEXT "About" -1, 0, 12, 160, 8
DEFPUSHBUTTON "OK" IDOK, 64, 60, 32, 14, WS_GROUP
}
However, this does not compile into a resource file, even if I
replace the symbolic constants by the actual values. In particular,
there seems to some problems with CTEXT and DEFPUSHBUTTON.
(It works in regular C programs).
Can anybody help me out? I would also appreciate a link, perhaps,
to a FreePascal program that uses the Windows API (and similar
constructs). In fact, links to FreePascal programs for Windows
in general are also welcome.
(BTW I'm using FreePascal 1.0.4 (the Windows version :)))
Thanks in advance,
Joris Vankerschaver
More information about the fpc-pascal
mailing list