Damit erzeugst Du eine Resource-Datei :
Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21:
| /* REM The batch file invokes BRCC32 then will immediately REM Jump to the END branch, bypassing the res file declarations @ECHO OFF CLS "brcc32" -foAbfrageLager -32 -v J:\BIS-Programmierung\Ressourcen-Datei\AbfrageLager.bat GOTO End */
/* BITMAPS */ PRINT BITMAP LOADONCALL MOVEABLE DISCARDABLE "J:\Cliparts\Images\AbfrageLager\PRINTER.BMP"
/* ICONS */
/* CURSORS */
/* AVI Files */
/* WAV Files */ /* :End */ |
Und so rufst Du die Resourcedatei im Delphi Source auf :
Delphi-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9:
| ...
implementation
{$R *.dfm} {$R *.res} {$R AbfrageLager.RES}
end. |
Um jetzt auf die Resource drauf zugreifen zu können mache folgendes :
Delphi-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13:
| procedure TSplashscreen.FormCreate(Sender: TObject); var hDLL : THandle; begin hDLL := LoadLibrary(PChar('ressource.dll')); if hDLL <> 0 then begin try Image1.Picture.Bitmap.LoadFromResourceName(hDLL, 'splash'); finally FreeLibrary(hDLL); end; end; end; |
Hier wird die Resource aus einer DLL geholt, die ich dynamisch einbinde.