Resource Export v1.0
(13th February 2000)
Documentation
Ó 2000 by Tom
Peiffer
Features - Usage - Installation - Properties - Methods - Events - Errorcodes - Author
Many users just use resource files (*.res) for the purpose of saving icons or wave files in them. After compilation, the icons and waves are included in the executable file, so that they need not to be distributed the the application.
With this component, you may include any file, also other executables, inside a resource file. The component is able to export these files again and write them to your harddisk. In this way, you can store complete other files inside your application.
Take a look to the demo project and you'll see the simplicity of using this component.
Copy the 2 files (ResourceExport.pas, ResourceExport.dcr) in your component
directory. In the component menu in Delphi, select Install component and choose
ResourceExport.pas. The component appears on the "Tom" palette in your
VCL.
property ResourceName : string ;
The internal name of your resource. (1. column in rc-file)
property ResourceCategory : string ;
The category name of your resource. (2. column in rc-file)
property ExportFileName : string ;
The filename of the exported file that is created after calling the Execute
method.
property Overwrite : boolean ;
If true, any existing file will be overwritten automatically. If fals, the
OnWriteFileError event is triggered.
property Size : integer ;
After calling the execute method, this property contains the size of the
exported resource.
function Execute : integer ;
This method exports the given resource to your disk. If the return value is 0,
the succeeded, else an error occured. See the ErrorCodes for details on return
values.
OnSuccess (Sender : TObject ; BytesWritten : integer) ;
The export of the resource succeeded. In BytesWritten you get the size of bytes
that have been written to your disk.
OnResourceNotFound (Sender : TObject) ;
See Errorcode reNotFound.
OnLoadResourceError (Sender : TObject) ;
See Errorcode reLoadError.
OnWriteFileError (Sender : TObject) ;
See Errorcode reFileExists.
reOK = 0 ;
reNotFound = 1 ; (the resource name could not be found)
reLoadError = 2 ; (The resource could not be loaded)
reFileExists = 4 ; (The file could not be written to your disk because Overwrite
is set to false and the file already exists)
Tom Peiffer (Physics student at University of
Kaiserslautern)
Hirtenweg 2
D-67661 Kaiserslautern
Germany
EMail: peiffer@rhrk.uni-kl.de
T.P. 2000