Autor Beitrag
man-u
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 28



BeitragVerfasst: So 23.01.05 12:43 
Kann mir mal einer vielleicht auf einfachem Wege erklären wie ich datein als resource in meine exe einbinde und sie im Quelltext aufrufe.

Wäre echt nett :)
AXMD
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: So 23.01.05 12:54 
bis11
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1247
Erhaltene Danke: 2

Apple Mac OSX 10.11

BeitragVerfasst: So 23.01.05 14:07 
Damit erzeugst Du eine Resource-Datei :

ausblenden 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 :

ausblenden 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 :

ausblenden 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.
man-u Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 28



BeitragVerfasst: So 23.01.05 20:39 
Titel: Danke
Danke dir ich probier sdas gleich mal aus :)