Solved

Property Bag

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

ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Eagerly loading related objects in entity framework 5 30
What can cause the styling on a .NET site to not be found? 17 26
HttpPostedFile 1 26
C# LINQ ForEach() question 6 28
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

803 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