Path: utzoo!news-server.csri.toronto.edu!rutgers!mit-eddie!mintaka!yale!cmcl2!adm!news From: DAVID@ches.cs.vims.edu Newsgroups: comp.lang.pascal Subject: Bitmaps in exe files Message-ID: <26239@adm.brl.mil> Date: 11 Mar 91 19:37:49 GMT Sender: news@adm.brl.mil Lines: 42 With regard to incorporating bitmaps into program files as requested by Dan.Bjorklund@samba.acs.unc.edu:- You can incorporate auxiliary data files into your program with the help of the BINOBJ utility supplied by Borland. Let's assume your file, DATA.REC is a 'file of rectyp', where *rectyp* is a type. Run BINOBJ using the command: BINOBJ DATA.REC DATA.OBJ MYDATA. This will generate an OBJ file that thinks it's a program with entry point MYDATA (or words to that effect). In the program that uses the data, include the statement: procedure MYDATA; external; {$L DATA.OBJ} To access the data, define a variable, p of pointer type: var p : pointer; and use typecasting to access the fields of the record: p := @mydata; with rectyp(p^) do begin { .... access the fields of the first record } end; {to skip to the next record, re-assign p} p := ptr( seg(p^), ofs(p^)+sizeof(rectyp) ); { or use similar assignments to calculate the pointer to any record in your data } Hope this helps - I've managed to use this technique without problems. If you need to update your data you have to go through the whole routine with BINOBJ and then re-compile the program. Something I've been looking at is incorporating a (hopefully) unique tag in the file so I can scan the executable EXE file for it, locate where the stuff is stored in the EXE file and replace it *in situ* without having to recompile. David Evans, DAVID@CHES.CS.VIMS.EDU