Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2002-04

Resource files & FreePascal

3 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Joris Vankerschaver

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

Jonas Maebe
to Joris Vankerschaver
Joris Vankerschaver wrote
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.

I can't help with your other problems, but here you can find some windows95 demo programs for FPC:
<http://www.perso.ch/bernard.gisin/FreePascal/index.html>. They're also mentioned in the "contributed units" section of the website.

Jonas

Joris Vankerschaver
Show quoted text 7 lines
Subject: Re: [fpc-pascal]Resource files & FreePascal From: Jonas Maebe I can't help with your other problems, but here you can find some windows95 demo programs for FPC: <http://www.perso.ch/bernard.gisin/FreePascal/index.html>. They're also mentioned in the "contributed units" section of the website.

Thanks a lot! This is just what I need, since I don't have any Delphi/TP books (except for a measly 250 page course).

I also found out what is (partly) causing my problem: in my resource file, there are two #include directives, but fprcp only processes the first. Is there a reason for this behaviour? (I'll (try to) fix it).

Thx,

Joris