xsharp.eu • Resource Compiler
Page 1 of 1

Resource Compiler

Posted: Tue Nov 23, 2021 1:19 pm
by ecos
Hi all,
in VO we could do something like

DEFINE MAINVERSION := "4"
DEFINE SUBVERSION := "0"
DEFINE MAINBUILD := "21"
DEFINE SUBBUILD := "12"

RESOURCE VS_VERSION_INFO VERSIONINFO
FILEVERSION MAINVERSION,SUBVERSION,MAINBUILD,SUBBUILD
......

The transporter replaces the defines in the resource with their actual values.
Is it still possible to use defines in resources or does anybody know a trick how to achieve this ?

TIA
Karl

Resource Compiler

Posted: Tue Nov 23, 2021 1:32 pm
by ic2
Hello Karl,

While Chris/Robert could no doubt explain why the Transporter replace values, we have a Defines.vh included in an X# program containing code like this:

#define CLM_RESOURCES 11326

So I'd say it is still possible like in VO (with a # before the define apparently).

Dick

Resource Compiler

Posted: Tue Nov 23, 2021 1:49 pm
by ecos
Hello Dick,

I always get

Fehler RC2104 undefined keyword or key name: MAINVERSION 12-proMOTM D:ProjekteproMO12-proMOTM___Version___.VS_VERSION_INFO.rc 2

no matter how I define MAINVERSION.

#define inside the rc-file seems to work, but I can't refer to defines elsewhere in the application...
Maybe the only solution for this will be include-files so that all rc-files in a solution can use the same defines..

Resource Compiler

Posted: Tue Nov 23, 2021 5:02 pm
by robert
Karl,
It is better that you do not add a version info resource to your DLL/EXE at all and use these defines in Assembly attributes. The compiler will then automatically generate the version resource for you.

Robert

Resource Compiler

Posted: Tue Nov 23, 2021 5:54 pm
by Chris
Hi Karl,

As Robert said, in .Net it is better to use version Assembly attributes for that. But if you insist to use a native resource, then the defines must be entered in the way the resource compiler (rc.exe) expects them:

#define MAINVERSION 4
#define SUBVERSION 0
#define MAINBUILD 21
#define SUBBUILD 12

Also you must not include the word RESOURCE in the .rc file, this is not recognised by the resource compiler, it is only used in VO to define the resource "entity"

.

Resource Compiler

Posted: Wed Nov 24, 2021 6:38 am
by ecos
Thanks for the hint, I think I can see what you mean in the ReportPro-source. I'll change my source accordingly

Karl