How to use structured storage files? 
Author Message
 How to use structured storage files?

Hi there...

How can I use structured storage files with Visual Basic 6 ???

My problem is: I made a print-system with a preview form (I don't use the VB
report tools...)...
A report is made of several print-sequence-objects collected in a
collection... It works fine and is very dynamic... I have to save the
print-data in a file.. So that I can load them when I need them
(unchanged!!!!!! Database independent...)... Now I convert my dynamic
collection of sequences to a user defined datatype and write that datatype
to a file...

With structured storage files I can put the object into a file, leave it
alone... And some day when it comes to load it, I can directly load it into
an object.... But how can I do this with VB???

Thank's in advance...


Cu,
Stephan Eberle
Oldenburg, Germany



Tue, 17 Dec 2002 03:00:00 GMT  
 How to use structured storage files?
You could use a PropertyBag object.
Just fill in your properties using WriteProperty method and store the
whole thing using the .Contents property.
After loading the byte array from a file, assign it to the .Contents
property
and read each property using the ReadProperty method.

Hope this helps
Alex


Quote:
> Hi there...

> How can I use structured storage files with Visual Basic 6 ???

> My problem is: I made a print-system with a preview form (I don't use the
VB
> report tools...)...
> A report is made of several print-sequence-objects collected in a
> collection... It works fine and is very dynamic... I have to save the
> print-data in a file.. So that I can load them when I need them
> (unchanged!!!!!! Database independent...)... Now I convert my dynamic
> collection of sequences to a user defined datatype and write that datatype
> to a file...

> With structured storage files I can put the object into a file, leave it
> alone... And some day when it comes to load it, I can directly load it
into
> an object.... But how can I do this with VB???

> Thank's in advance...


> Cu,
> Stephan Eberle
> Oldenburg, Germany



Tue, 17 Dec 2002 03:00:00 GMT  
 How to use structured storage files?

Quote:
> You could use a PropertyBag object.
> Just fill in your properties using WriteProperty method and store the
> whole thing using the .Contents property.
> After loading the byte array from a file, assign it to the .Contents
> property
> and read each property using the ReadProperty method.

...and if there are collections or arrays to store, it is a bit more tricky.
But I've shown a generic solution for that in:

http://www.aboutvb.de/kom/artikel/kompropertybag.htm

(Article is written in German, but the code is international ;-)

Regards,

Harald M. Genauck

ABOUT Visual Basic - das Webmagazin
http://www.aboutvb.de



Thu, 19 Dec 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Structured storage - done it using VB?

2. Structured Storage with .NET

3. Structured Storage

4. Structured Storage

5. Structured Storage

6. Repost: OLE Structured Storage

7. Help find a demo Structured Storage OCX

8. OLE Structured Storage in VB5?

9. Structured Storage For Visual Basic

10. VB Data Structure for Email Storage

11. Structured Storage

12. HELP: Classes for OLE2 Structured Storage

 

 
Powered by phpBB® Forum Software