TPropertySet


TPropertySet_U1.pas contains the TPropertySet class. This class can read/write a property set from a stream. It was written to be used to read/write the Win95 SummaryInformation property set, and thus does not support all the property set features. You can also download my TSummaryInformation class which simplifies reading/writing the SummaryInformation property set even further.

TPropertySet only supports single section property sets in the US-Ansi ($4e4) code page, and only supports the following types LPSTR, BSTR, FileTime, I4, I2, CLSID, Bool. It will however read the unsupported types, but not load their data. See my DocFile Viewer for and example of using this class.

This class uses my TDocFileStream class and thus requires Delphi 3.x



Download

Name ZIP Size
TPropertySet_U1 TPropertySet_U1.zip 4kb



constructor Create( CLSID : TCLSID; FormatID : TCLSID );
Creates the class with the given CLSId and FormatID

procedure ClearAll;
Removes all properties

property PropertyCount : integer;
Returns number of properties

procedure EnumProperties_Variant( ... );
Enum all properties, property values are passed in a variant. NB not all types are supported by a variant (eg VT_CLSID)

procedure EnumProperties_Pointer( ... );
Enum all properties, property values are passed as a pointer to the data

function SaveToStream( ... ) : boolean;
Saves current properties to an existing IStream

function LoadFromStream( ... ) : boolean;
Loads a property set from an existing IStream

function Add_LPSTR( ... ) : boolean;
Add a string property

function Add_BSTR( ... ) : boolean;
Add a string property

function AddFileTime( ... ) : boolean;
Add a FileTime property

function Add_I4( ... ) : boolean;
Add a I4 (DWORD) property

function Add_I2( ... ) : boolean;
Add a I2 (SHORT) property

function Add_CLSID( ... ) : boolean;
Add a CLSID property

function AddBool( ... ) : boolean;
Add a boolean property

5%"> function AddBool( ... ) : boolean; Add a boolean property