Solved

Property Bag

Posted on 2004-08-12
5
1,009 Views
Last Modified: 2008-03-10
I have some VB6 DLL's that we really want to use as is again.  The problem as is is that the DLL's use PropertyBag objects as input parameters.  I have been trying to create serializable objects that I can then load into the property bag but this does not work...or atleast it does not seem to work and they don't even really seem to be the same thing.

Does anyone have any ideas on how this can be done without editing the VB6 DLL's.  I really only want to do this as a last resourt.

Thanks,
Eric
0
Comment
Question by:egibson
  • 2
  • 2
5 Comments
 
LVL 96

Assisted Solution

by:Bob Learned
Bob Learned earned 250 total points
ID: 11783745
I think that you will find that you will continually struggle with this, since you are trying to fit a square peg into a round hole.  You could probably make it fit, but it will take a very large hammer:)

PropertyBag is VB6 is not a text object, but is a binary object.  You would need to create the exact same binary representation.  My only suggestion would be to do what you don't want to do, and that is modify the VB6 code to make your life easier in the long run.

Bob
0
 
LVL 24

Accepted Solution

by:
Justin_W earned 250 total points
ID: 11788518
One possible workaround might be to add one (or a few) utility functions to the VB6 DLL that accept more "compatible" params and create/return a PropertyBag.  Then you could use the new functions to create the right params without actually creating a PropertyBag directly.
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 11788524
Another good suggestion:)  One that proves that leaving the VB6 code intact is not a good idea in this situation.

Bob
0
 
LVL 24

Expert Comment

by:Justin_W
ID: 11788617
> One that proves that leaving the VB6 code intact is not a good idea in this situation.
:) Both amusing and correct, Bob.
0
 

Author Comment

by:egibson
ID: 11854413
Well, I think I got this one worked out.  You can use the VBRUN.PropertyBag object to get the just back and forth but it is a pain.  I think the end result will be to adjust the VB6 code to take a string of XML which can then be broken down back into a property bag if you so wanted or manipulated directly.

We experimented with both approacess and they look to be about equal.  Both suck!!!

Anyways, thanks for the suggestions,
Eric
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction                                                 Was the var keyword really only brought out to shorten your syntax? Or have the VB language guys got their way in C#? What type of variable is it? All will be revealed.   Also called…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…
Concerto provides fully managed cloud services and the expertise to provide an easy and reliable route to the cloud. Our best-in-class solutions help you address the toughest IT challenges, find new efficiencies and deliver the best application expe…

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now