Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

saving an embeded .exe to a file

18 views
Skip to first unread message

Robert Shurtliff

unread,
Aug 1, 1997, 3:00:00 AM8/1/97
to

Is it posible to embed a .exe program in your own delphi program and on
creation or when a cirtian event happens (ie a button push,etc..) the
..exe is copied to the root directory?

When I try to do this, my .exe which is called a olecontainer package is
saved to a file but it delphi seems to also save other ole info with my
..exe and makes it corrupted. I am using a simple
olecontainer1.savetofile('test.exe'); is this my problem and is there a
better way?


Arjan van der Leden

unread,
Aug 2, 1997, 3:00:00 AM8/2/97
to

Well what I do is the following:
with a resource compiler you compile the exe file into a RES file
this res file you include in your program with the {$R filename.RES}
in Delphi 16 bit you have to use
findresource,
lockresource,
copy to a stream using stream.write(pLockedResource, SizeofResource),
stream.savetofile

In Delphi 2.0 you can use a TResourceStream
Works fine ...

Succes,
Arjan van der Leden
ar...@paremion.nl


Robert Shurtliff <shur...@ix.netcom.com> wrote in article
<33E204EA...@ix.netcom.com>...

0 new messages