On Thu, 14 Sep 2006 09:22:10 +0200 (Romance Daylight Time)
Michael Van Canneyt <[EMAIL PROTECTED]> wrote:

> 
> 
> On Wed, 13 Sep 2006, Mattias Gaertner wrote:
> 
> > On Wed, 13 Sep 2006 20:54:05 +0200
> > Jouke Rensma <[EMAIL PROTECTED]> wrote:
> >
> >> Mattias,
> >>
> >> When you use the VersionInfo for the first time, the main source is
> >> not updated with a $R <projectname>.res} line. The code as it is
> >> now, updates this using the codetools. However, this happens after
> >> all files have been saved for compilation. This results in that
> >> main source is updated, but the compiler uses the file from disk
> >> without the updated line.
> >>
> >> Saving the file can be easily done using TCodeBuffer.SaveToFile.
> >> However this does not reset the modified flag. Result will be that
> >> lazarus asks to save the file, while the file on disk is already up
> >> to date.
> >>
> >> I searched trough the codetools, but could not find out how to
> >> solve this problem. What should I use???
> >
> > The $R should be added, when the project is created or the version
> > info is enabled (when clicking the ok button of the project
> > options). Not on build and not on saving project.
> >
> > BTW,
> > How do you make sure, that the $R is only used under windows?
> > If you create a project under windows with version info and compile
> > it under linux, the same source must compile without changing the
> > source. With {$IFDEF MSWindows}{$R projectname.res}{$ENDIF} ?
> 
> Isn't it better to do:
> 
> {$IFDEF LazarusVersionInfo}{$R projectname.res}{$ENDIF}
> 
> The IDE can define this whenever it is necessary.

Good idea. When some new targets support resource files with version
information, the IFDEF will stay short.
OTOH: Is there any other platform with version resource files?


Mattias

_________________________________________________________________
     To unsubscribe: mail [EMAIL PROTECTED] with
                "unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to