Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic store custom data using VariantTag (Read 4581 times)
Eric
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 2
Joined: Aug 7th, 2005
store custom data using VariantTag
Aug 23rd, 2005 at 11:04am
Print Post  
Hi,

I would like to store several custom fields for each box using the VariantTag property, which supposedly can store any VARIANT value. Using VB6 how can I create a VARIANT structure, containing several properties of different types, which can be saved and loaded with the FlowChartX diagrams?

Thank you in advance
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: store custom data using VariantTag
Reply #1 - Aug 23rd, 2005 at 2:50pm
Print Post  
Hi,

FlowChartX can save in files the following kinds of objects that might be stored in a variant:

- simple types such as integer, boolean, real
- strings
- OLE safearrays of variants
- serializable COM objects

I guess in your case it is easiest to use the safearray of variants option. OLE safearrays are the type of arrays implemented in VB6, so you could declare an array like this:

Dim myBoxProperties(10) As Variant

Each member of the array must be serializable in order for the whole array to be saved or loaded.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: store custom data using VariantTag
Reply #2 - Aug 23rd, 2005 at 3:36pm
Print Post  
And if you need to use a COM object to store the additional data, you can make it serializable like this:

- Create an ActiveX dll project
- in the property browser for the class choose 'Persistable'
- implement the following methods

Private Sub Class_ReadProperties(PropBag As PropertyBag)

End Sub

Private Sub Class_WriteProperties(PropBag As PropertyBag)

End Sub

and use the PropBag parameter to save or load your own properties

- add a reference to the ActiveX dll in your main project ; now you can assign instances of this class to VariantTag
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint