This site is moving to The Zen Source Library
Please Update your bookmarks


CLSIDs

A CLSID is a very large number 16byte (128 bit) number that is used to uniquely identify "things". CLSIDs uniquely identify interfaces, objects, components etc etc... For this article is only important to know that a CLSID can be used to identify a storage.

There are many reasons for giving a storage CLSIDs. The exact reason obviously depends on your application and needs. CLSIDs are used extensively with the IPersistStorage interface when 3rd party apps are allowed to save and load their data from within a owner apps storage.

Identifying a storage in this manner is still very useful even when not working with IPersistStorage or other OLE technologies. So I'll show you how its done.

Here is a function that is used to return a given storage's CLSID


   function GetStorageCLSID(  Storage : IStorage  ) : TCLSID;
   var
      StatStg : TSTATSTG;
   begin
      Storage.Stat(  StatStg,  0  );
      Result := StatStg.clsid;
   end;

Setting a storage's CLSID is even easier


   Storage.SetClass(  CLSID_WHAT_EVER  );

Where CLSID_WHAT_EVER is a CLSID defined by you.






All information on these www pages is copyright (©) 1997 Andre .v.d. Merwe And may not be copied or mirrored without my permission.