Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Property Bag

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

809 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