RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TCustomLocateFileService.FindStream Method

Generates an OnFindStream event.

Pascal
function FindStream(AComponent: TComponent; const AFileName: string; out AResult: TStream; out AOwned: Boolean): Boolean; virtual;
C++
virtual __fastcall Boolean FindStream(TComponent * AComponent, const AnsiString AFileName, TStream AResult, Boolean AOwned);

TCustomLocateFileService calls FindStream internally to generate an OnFindStream event. 

AComponent is the object that uses or is associated with the requested file. Typically, this is a content producer. 

AFileName is the name of the file to locate. This can be a "logical" file that does not exist on disk. 

AResult returns a stream from which the caller can read the contents of the requested file. 

AOwned indicates whether the caller should free AResult after reading the file contents. When AOwned returns true, the caller should free the stream object. When AOwned returns false, the caller should not free the stream object. 

FindStream returns true if it supplies a stream as the value of the AResult parameter. It returns false if there is no OnFindStream event handler or if the event handler does not return a value for AResult. 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!