ObjectMaster    
Download
Buy
ObjectMaster is an ActiveX control which makes it possible to easily create copies of an object in Visual Basic 6, or to save object's properties to a file and later to reconstruct the object from the file, even if the object has other subobjects. And all that with a single line of code.

You have probably had the need to create a copy of an existing instance of some object, i.e. with the values of the properties which that specific instance possesses in that moment.
As you know, an approach such as

         
Dim DestinationObject As New MyObject
         
Set DestinationObject=SourceObject

will not give the wanted results because both DestinationObject and SourceObject variables reference to the same object and therefore they are not independent, which means that if you change a property of SourceObject, this change will affect DestinationObject, and most often this is not what is wanted when one needs an object copy.

Creating an object copy with ObjectMaster is as simple as

         
Dim DestinationObject As MyObject
         
Set DestinationObject=ObjectMaster1.Copy(SourceObject)

The created copy is identical to the original object and is absolutely independent of it. You can change or destroy the original object and this will not affect the created copy. You can make as many copies as you want.

The second important purpose of ObjectMaster is so called "Object Persisting", which means putting the values of the object properties into some sort of a data stream which can be saved into a file or sent to the clipboard, from which the original object can be reconstructed later. With ObjectMaster this is as simple as

 
persisting: OMStream=ObjectMaster1.StreamFromObject(SourceObject)
reconstruction:   Set DestinationObject=ObjectMaster1.ObjectFromStream(OMStream)
where OMStream is a byte array into which the data are written, so called "Stream".

ObjectMaster makes it possible to copy and persist an object even if the object contains properties which are objects themselves, and these subobjects can contain other subobjects and so on.

 

 

Copyright 2012 Paunsoft. All Rights Reserved.