comp.lang.ada
 help / color / mirror / Atom feed
From: "Vladimir Olensky" <vladimir_olensky@yahoo.com>
Subject: Re: Binding Win32 resources into GNAT executables?
Date: 2000/02/10
Date: 2000-02-10T00:00:00+00:00	[thread overview]
Message-ID: <sa5aeuou53n169@corp.supernews.com> (raw)
In-Reply-To: 38A296A4.B9AE7D1D@bton.ac.uk


John English wrote in message <38A296A4.B9AE7D1D@bton.ac.uk>...
>I've been playing with Win32 bindings under GNAT but have run into
>a problem with dialogs, which are defined in a resource file.  The
>resource file has been compiled from a .rc file to a .res file, but
>I'm at a loss as to how to link this into my executable. Gnatlink
>doesn't recognise the format of the .res file (which surpises me
>very little), and I presume I'm just being extremely dense.
>
>Can anyone out there help this particular bear-of-very-little-brain
>solve what must presumably be an extremely trivial problem?
>
>Also, is there any way of binding resources into an object file
>so that a package can be distributed in compiled form with all
>the resources built in?


Current GNAT linker does not understand  *.RES
file format.

One need to convert it to the valid object file.

It could be done using resource compiler RCL.EXE that
comes with the GNAT 3.12p for WinNT.

-------------------------------------------------
> rcl ?

RCL 2.2 - Resource Compiler
          modified by ACT for GNAT

usage: rcl <options>

        options:
        -i <.rc file>         resource text or .res file
        -pe <executable>      output is a PE file (.exe or .dll)
        -r <.res file>        output is a .res file
        -o <.o file>          output is a COFF object file
        -cpp <preprocessor>   specify a preprocessor program
        -v                    verbose mode

---------------------------------------------------------------
Another option is to use MSVS RC compiler and CVTRES
converter .

Below is a batch file for last option:

echo off
rem
rem  File Name: make_rbj bat
rem
rem  Author:  Vladimir Olensky
rem  Purpose: Compiles windows resource template file  NAME.RC
rem       to object file NAME.RBJ that can be linked with
rem           the Ada Win32 program
rem
rem  Notes: 1.You should have pragma Linker_Options("NAME.RBJ")
rem           in the main Ada program unit
rem         2.Be sure that include files within the NAME.RC are in
rem           the same directory  with NAME.RC or at least
rem           visible to rc.exe.
rem
rem         3. rc.exe and cvtres.exe are part of the MS VC++
rem
echo on
RC -r -DWIN32 -fo %1.tmp %1.rc
cvtres -i386 %1.tmp -o %1.rbj
del %1.tmp

Regards,
Vladimir Olensky






      parent reply	other threads:[~2000-02-10  0:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-02-10  0:00 Binding Win32 resources into GNAT executables? John English
2000-02-10  0:00 ` David Botton
2000-02-10  0:00 ` Ted Dennison
2000-02-11  0:00   ` John English
2000-02-11  0:00     ` Ted Dennison
2000-02-11  0:00       ` John English
2000-02-10  0:00 ` Vladimir Olensky [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox