No announcement yet.

Compiling a resource script

  • Filter
  • Time
  • Show
Clear All
new posts

  • Compiling a resource script

    Does the compiler key off a .rc extension to know that it should create .res and .pbr files? Or can I use any a resource script extension I want?

    I created a .rc file and used the normal compile button. That worked. I'm just trying to understand the process better.


  • #2
    The compiler shellexecutes (or equal) "RC.EXE sourcefilename " and maybe some options.
    Microsoft Windows XP [Version 5.1.2600]
    (C) Copyright 1985-2001 Microsoft Corp.
    D:\Software_Development\pbwin90\bin>rc /?
    Microsoft (R) Windows 32 Resource Compiler, Version 4.00 - Build 1367
    Usage:  rc [options] .RC input file
       /r    Emit .RES file (optional)
       /v    Verbose (print progress messages)
       /d    Define a symbol
       /u    Undefine a symbol
       /fo   Rename .RES file
       /l    Default language ID in hex
       /i    Add a path for INCLUDE searches
       /x    Ignore INCLUDE environment variable
       /c    Define a code page used by NLS conversion
    Flags may be either upper or lower case
    Then it shellexecutes PBRES.EXE against the *.RES file created by RC.EXE
    D:\Software_Development\pbwin90\bin>pbres /?
    PBRES - PowerBASIC Resource Converter
    Copyright (c) 1997-2000 PowerBASIC, Inc.
    Usage:  PBRES filename[.res]
    Apprently there aren't many options for this. But PBRES command-line usage SHOULD be in the help file.

    Michael Mattias
    Tal Systems (retired)
    Port Washington WI USA
    [email protected]


    • #3
      Thanks for the response. With the flash-up of the DOS window that occurs when I compiled an RC file, it was clear that the compiler was using the command line tools.

      But since there was no "Compile Resource File" menu selection, I wasn't completely sure how the compiler knew to create RES/PBR files vs just going ahead with an EXE/DLL compile attempt (which would fail).

      When I simply changed the RC extension to something else, the compiler ignored the file completely. I'll just stick with the RC extension since the compiler seems to trigger off the extension to know whether to shellexecute the command line tools.



      • #4
        You can set the extensions for "source files" and "resource files" in the IDE, but I don't know if those settings are used for "compile" or only for "open"

        IIRC older (6x, 5x?) versions of IDE you actually entered the command line on some screen, so you could run a the compile with your own options. But you can't do that anymore, your choice of options has been pre-selected for you.
        Michael Mattias
        Tal Systems (retired)
        Port Washington WI USA
        [email protected]