RAD Studio VCL Reference
THandleStream.Handle Property

Specifies the handle for the communications resource the stream reads from and writes to.

property Handle: THandle;
__property THandle Handle;

Read Handle to get the handle for file management functions. To read from or write to the resource, use the methods of the THandleStream object. 

Handle is a read-only property. The handle property cannot be changed to allow the handle stream to switch from reading to writing or vice versa. For example, to change from a file handle that is opened in read-only mode to one that is opened in write mode: 

1Free the stream object. 

2Call FileClose to close the file. 

3Reopen the file in write mode, and use the handle to create a new instance of a handle stream. Alternately, open a TFileStream object for the file, specifying a write mode for the stream.

Note: Do not call the FileClose function on the Handle until after the THandleStream object has been destroyed.


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