New version of GoRC (resource compiler)

From: Jeremy Gordon (jg@jgnet.co.uk)
Date: Fri Oct 29 2004 - 06:10:49 CST

  • Next message: Rick Cameron: "[OT] Uniscribe in Windows XP SP2"

    This is for users of my GoRC resource compiler for Windows programming, who want to use non-Roman characters in their resource names(IDs) and resource types when using Unicode rc files.

    I was experimenting recently with this and I found that GoRC was only capitalising the nameIDs and types properly when using English, or languages using a to z and A to Z. Lower case in Greek or Cyrillic was a problem. Microsoft's RC.exe was giving the same output as GoRC.
    I have now dealt with this in the latest GoRC version 0.87 available from here.

    I'll just explain a bit more about this, by using an edited excerpt from the GoRC help file.

    A resource nameID can either be a string of characters or a number, for example:-
         
          MyCurs CURSOR hello.cur
          0x22 CURSOR hello.cur

    For each type of resource with a particular language the nameID must be unique. Ie. two dialogs can have the same nameID provided they have different language values.

    A user-defined resource will have a resource type identified by a string of characters or a number, for example:-
         
          788h MyRes readme.txt
          788h 455 readme.txt

    Now, the Resource Compiler will always convert the nameID or type to upper case when inserting them in the RES file or OBJ file. The reason for this is that this is expected by Windows. In practice this does not affect the way you use the resource because the system will also capitalise any nameIDs or types given to the resource APIs. For example suppose you have a dialog with a nameID of "MyDlg". Then to use the dialog you would pass the string "MyDlg" to the Windows API CreateDialog. But in fact, the system converts the string to MYDLG and then looks for that string (as converted) in the executable.

    This has two implications to developers.

    Firstly it means that there would be a conflict in the above example if you had a second dialog (with the same language value) called MYDLG. This would be picked up at link-time by the linker.

    Secondly, the Resource Compiler must ensure that not only English nameIDs or user-defined types are converted properly to upper case. GoRC now relies on the API CharUpper to do this conversion. This API can handle a number of languages properly, but it does rely on language mapping. Ensure that the machine used for compiling does support the language used in the nameIDs and user-defined types. No conversion will take place in those languages which do not actually have an upper case.
    _________________
    Jeremy Gordon
    www.GoDevTool.com



    This archive was generated by hypermail 2.1.5 : Fri Oct 29 2004 - 06:21:20 CST