Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

Resource Compiler 23 Nov 2021 14:19 #20498

  • ecos


  • Posts: 25
  • 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

    Please Log in or Create an account to join the conversation.

    Resource Compiler 23 Nov 2021 14:32 #20499

    • ic2


  • Posts: 1183
  • 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

    Please Log in or Create an account to join the conversation.

    Resource Compiler 23 Nov 2021 14:49 #20501

    • ecos


  • Posts: 25
  • Hello Dick,

    I always get

    Fehler RC2104 undefined keyword or key name: MAINVERSION 12-proMOTM D:\Projekte\proMO\12-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..

    Please Log in or Create an account to join the conversation.

    Last edit: by ecos.

    Resource Compiler 23 Nov 2021 18:02 #20505

    • robert
    • robert's Avatar


  • Posts: 2475
  • 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
    XSharp Development Team
    The Netherlands

    Please Log in or Create an account to join the conversation.

    Resource Compiler 23 Nov 2021 18:54 #20507

    • Chris
    • Chris's Avatar


  • Posts: 2860
  • 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"

    .
    XSharp Development Team
    chris(at)xsharp.eu

    Please Log in or Create an account to join the conversation.

    Resource Compiler 24 Nov 2021 07:38 #20514

    • ecos


  • Posts: 25
  • Thanks for the hint, I think I can see what you mean in the ReportPro-source. I'll change my source accordingly

    Karl

    Please Log in or Create an account to join the conversation.

    • Page:
    • 1