Solved

Property Bag

Posted on 2004-08-12
5
1,005 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

708 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

13 Experts available now in Live!

Get 1:1 Help Now