From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,FREEMAIL_FROM, INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,6256d003d70668b X-Google-Attributes: gid103376,public From: "Vladimir Olensky" Subject: Re: Binding Win32 resources into GNAT executables? Date: 2000/02/10 Message-ID: #1/1 X-Deja-AN: 584098104 References: <38A296A4.B9AE7D1D@bton.ac.uk> Organization: Posted via Supernews, http://www.supernews.com X-MIMEOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Newsgroups: comp.lang.ada X-Complaints-To: newsabuse@supernews.com Date: 2000-02-10T00:00:00+00:00 List-Id: 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: -i <.rc file> resource text or .res file -pe 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 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