PBXB64 Ressourcen-Compiler

Ressourcen-Compiler Standard

Volle Windows-Ressourcen-Unterstützung with the #RESOURCE directive. Compile .rc files to .res and in Executables verlinken. Korrigiertes Null-terminiertes Path-Parsing and Empty-Include-windres-Absturz. Vollständiger Regressionstest: test_resource.pb.

#RESOURCE-Direktive

Ressourcen-Kompilierung in PB
' In your .pb source file: #RESOURCE "myapp.rc" FUNCTION PBMAIN() AS LONG ' The .rc file is compiled to .res and linked ' automatically during the build FUNCTION = 0 END FUNCTION

The #RESOURCE directive tells PBXB64 to compile the specified .rc file to .res and link it into the final executable. The compiler handles the full .rc -> .res pipeline internally.

.RC-Datei-Beispiel

Windows-Ressourcen-Skript
// myapp.rc #include "windows.h" APP_ICON ICON "app.ico" IDD_DIALOG DIALOG 0, 0, 200, 100 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION CAPTION "My Dialog" BEGIN DEFPUSHBUTTON "OK", IDOK, 10, 70, 50, 14 PUSHBUTTON "Cancel", IDCANCEL, 130, 70, 50, 14 END STRINGTABLE BEGIN IDS_HELLO "Hello from resources" END VERSIONINFO VERSIONINFO FILEVERSION 1,0,0,0 PRODUCTVERSION 1,0,0,0 BEGIN BLOCK "StringFileInfo" BEGIN BLOCK "040904E4" BEGIN VALUE "FileDescription", "My Application" VALUE "FileVersion", "1.0.0.0" END END END

Standard Windows-.rc-Syntax: icons, dialogs, string tables, version info, menus, and bitmaps. The compiler uses windres to compile .rc to .res, then links the .res into the PE executable.

CLI - Ressourcen-Kompilierung

Mit Ressourcen kompilieren
REM Compile PB with .rc file PBXB64 myapp.pb -o myapp.exe REM The compiler automatically: REM 1. Finds #RESOURCE "myapp.rc" REM 2. Compiles myapp.rc to myapp.res via windres REM 3. Links myapp.res into the final .exe REM Check resources are embedded PBXB64 myapp.pb -o myapp.exe --verbose

Die .rc -> .res-Pipeline ist vollautomatisch. The compiler detects #RESOURCE directives, invokes windres with proper null-terminated path handling, and links the resulting .res into the PE32+ executable.

Zurück zur Feature-Liste