comp.lang.ada
 help / color / mirror / Atom feed
* Re: Binding Win32 resources into GNAT executables?
  2000-02-10  0:00 Binding Win32 resources into GNAT executables? John English
@ 2000-02-10  0:00 ` Ted Dennison
  2000-02-11  0:00   ` John English
  2000-02-10  0:00 ` David Botton
  2000-02-10  0:00 ` Vladimir Olensky
  2 siblings, 1 reply; 7+ messages in thread
From: Ted Dennison @ 2000-02-10  0:00 UTC (permalink / raw)


In article <38A296A4.B9AE7D1D@bton.ac.uk>,
  John English <je@bton.ac.uk> wrote:
> 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.

If you installed everything in the default locations, there's a
section in the super-secret documentation (the GNAT for Windows NT:
User's Guide) that describes all this at
file:///C|/GNAT/Documentation/gnat_ug.html#SEC185 . If you need to find
this document again, it should be hidden in your start menu under the
program group "Gnat Ada95 Compiler. But don't tell anyone I told you.
;-)

--
T.E.D.

http://www.telepath.com/~dennison/Ted/TED.html


Sent via Deja.com http://www.deja.com/
Before you buy.




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Binding Win32 resources into GNAT executables?
  2000-02-10  0:00 Binding Win32 resources into GNAT executables? John English
  2000-02-10  0:00 ` Ted Dennison
@ 2000-02-10  0:00 ` David Botton
  2000-02-10  0:00 ` Vladimir Olensky
  2 siblings, 0 replies; 7+ messages in thread
From: David Botton @ 2000-02-10  0:00 UTC (permalink / raw)


I do it all the time. You need to either use one of the GNU resource
compilers (I like windres http://www.adapower.com/com/windres.zip) that
produces coff output or use the MSVC tool to change a res to obj file. Then
link with the resulting obj file.

David Botton


John English wrote in message <38A296A4.B9AE7D1D@bton.ac.uk>...
>I'm at a loss as to how to link this into my executable.








^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Binding Win32 resources into GNAT executables?
  2000-02-10  0:00 Binding Win32 resources into GNAT executables? John English
  2000-02-10  0:00 ` Ted Dennison
  2000-02-10  0:00 ` David Botton
@ 2000-02-10  0:00 ` Vladimir Olensky
  2 siblings, 0 replies; 7+ messages in thread
From: Vladimir Olensky @ 2000-02-10  0:00 UTC (permalink / raw)



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






^ permalink raw reply	[flat|nested] 7+ messages in thread

* Binding Win32 resources into GNAT executables?
@ 2000-02-10  0:00 John English
  2000-02-10  0:00 ` Ted Dennison
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: John English @ 2000-02-10  0:00 UTC (permalink / raw)


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?

TIA,

-----------------------------------------------------------------
 John English              | mailto:je@brighton.ac.uk
 Senior Lecturer           | http://www.it.bton.ac.uk/staff/je
 Dept. of Computing        | ** NON-PROFIT CD FOR CS STUDENTS **
 University of Brighton    |    -- see http://burks.bton.ac.uk
-----------------------------------------------------------------




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Binding Win32 resources into GNAT executables?
  2000-02-11  0:00   ` John English
@ 2000-02-11  0:00     ` Ted Dennison
  2000-02-11  0:00       ` John English
  0 siblings, 1 reply; 7+ messages in thread
From: Ted Dennison @ 2000-02-11  0:00 UTC (permalink / raw)


In article <38A3FAD6.3EBAC1D7@bton.ac.uk>,
  John English <je@bton.ac.uk> wrote:
> Ted Dennison wrote:
> > section in the super-secret documentation (the GNAT for Windows NT:
> Ho ho, very funny, Ted. Your advice would be welcome if I'd got 3.12
> installed, but the 3.11 guide only goes up to #SEC162 (the index),
> so I'm afraid it doesn't help one bit. I may be dense, but I do
> try to RTFM before I ask my stupid questions, honest...

I have to admit I was a bit suprised that *you* would ask a question
that was answered in the manual. But were it me, I'd be way more likely
to have neglected to read the new manual entries before asking than to
be using an older version of gnat 4 months after the newer version had
been released, and then not mention that fact when asking. I just
assumed you thought like me. Fortunately for you and everyone around
you, you don't. :-)

Anyway, I obviously jumped to the wrong conclusion. Please accept this
virutal noodle:
     ___
_,--'   \____,-------.__


I think the appropriate punishment would be 5 lashes.

--
T.E.D.

http://www.telepath.com/~dennison/Ted/TED.html


Sent via Deja.com http://www.deja.com/
Before you buy.




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Binding Win32 resources into GNAT executables?
  2000-02-10  0:00 ` Ted Dennison
@ 2000-02-11  0:00   ` John English
  2000-02-11  0:00     ` Ted Dennison
  0 siblings, 1 reply; 7+ messages in thread
From: John English @ 2000-02-11  0:00 UTC (permalink / raw)


Ted Dennison wrote:
> In article <38A296A4.B9AE7D1D@bton.ac.uk>,
>   John English <je@bton.ac.uk> wrote:
> > 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.
> 
> If you installed everything in the default locations, there's a
> section in the super-secret documentation (the GNAT for Windows NT:
> User's Guide) that describes all this at
> file:///C|/GNAT/Documentation/gnat_ug.html#SEC185 . If you need to find
> this document again, it should be hidden in your start menu under the
> program group "Gnat Ada95 Compiler. But don't tell anyone I told you.
> ;-)

Ho ho, very funny, Ted. Your advice would be welcome if I'd got 3.12
installed, but the 3.11 guide only goes up to #SEC162 (the index),
so I'm afraid it doesn't help one bit. I may be dense, but I do
try to RTFM before I ask my stupid questions, honest...

However, Vladimir's response about using the RCL that comes with
3.12 was much more helpful (and he actually mentioned the fact that
I would need 3.12 to follow his advice), so I might upgrade soon.
Meanwhile, I've grabbed WINDRES as per David Botton's advice,
which was also extremely helpful and solved my problem straight
away without my having to reinstall GNAT on a whole bunch of
machines.

So, thanks Vladimir, thanks David.

-----------------------------------------------------------------
 John English              | mailto:je@brighton.ac.uk
 Senior Lecturer           | http://www.it.bton.ac.uk/staff/je
 Dept. of Computing        | ** NON-PROFIT CD FOR CS STUDENTS **
 University of Brighton    |    -- see http://burks.bton.ac.uk
-----------------------------------------------------------------




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Binding Win32 resources into GNAT executables?
  2000-02-11  0:00     ` Ted Dennison
@ 2000-02-11  0:00       ` John English
  0 siblings, 0 replies; 7+ messages in thread
From: John English @ 2000-02-11  0:00 UTC (permalink / raw)


Ted Dennison wrote:
> I have to admit I was a bit suprised that *you* would ask a question
> that was answered in the manual. But were it me, I'd be way more likely
> to have neglected to read the new manual entries before asking than to
> be using an older version of gnat 4 months after the newer version had
> been released, and then not mention that fact when asking. I just
> assumed you thought like me. Fortunately for you and everyone around
> you, you don't. :-)

My apologies too, Ted -- things are a bit hectic at the moment so
I'm inclined to bite back. :-(  I certainly should have mentioned
I was still on 3.11.

Anyway, I will now find time to install 3.12 -- although it involves
doing it on a load of machines in scattered places, which is why I
haven't got around to it yet -- and then perhaps I won't have to
ask so many stupid questions in future... ;-)

Cheers,

-----------------------------------------------------------------
 John English              | mailto:je@brighton.ac.uk
 Senior Lecturer           | http://www.it.bton.ac.uk/staff/je
 Dept. of Computing        | ** NON-PROFIT CD FOR CS STUDENTS **
 University of Brighton    |    -- see http://burks.bton.ac.uk
-----------------------------------------------------------------




^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2000-02-11  0:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-02-10  0:00 Binding Win32 resources into GNAT executables? John English
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 ` David Botton
2000-02-10  0:00 ` Vladimir Olensky

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