PDA

Click to See Complete Forum and Search --> : Persisiting an array via PropertyBag


BradBrening
Oct 19th, 2001, 04:57 PM
I am creating an ActiveX control that will allow a developer to add constituent controls at design time. I need to be able to put into the PropertyBag the state of each of the constituent controls (i.e. top, size, color, etc.) as well as the count of the constituent controls added. How would this be accomplished?

As far as I can tell, the only thing that can be saved into the Propertybag is a key/value pair. I know that objects can be used as the value, but does this include user-defined objects? And although I can iterate through the constituent control collection/array and perform a WriteProperty, how do I iterate through during ReadProperties to the upperbound of the array?

I hope I haven't muddled up this question too much, this issue has really got me scratching my head. I cannot seem to find any documentation that addresses this issue.

Any help or insight would be greatly appreciated! Thanks in advance!

BradBrening
Oct 20th, 2001, 12:50 PM
AAAGGGHHHH! I should have known that answer! Thanks a ton for your assistance. This just reinforces the idea that the answer is usually right under your nose...

Once again, thanks a ton!

Abu haider
Oct 20th, 2001, 03:50 PM
Ever tried that code?
A collection is not persistable, nor the controls. Try it.

jim mcnamara
Oct 22nd, 2001, 05:33 PM
Abu - I think Brad answered your question.

Brad - have no clear idea. What appears in Intellisense is derived from the type library associated with the class object.

You are going to have to create your own .tlb for your project.
You can get idl from MDSN online, so you can compile it, at least.

Abu - since you're helping, too - any ideas? I'm all out.