Click to See Complete Forum and Search --> : Is This Possible (urgent!)
tmatbeam
Dec 6th, 2000, 02:54 PM
Hi,
I am trying to store an object in a file. Is this possible?
Dim objTemp As Object
Set objTemp = CreateObject("Something.something")
objTemp.DoSomething
objTemp.DoSomethingelse
now, before I do "Set objTemp = Nothing" I want to store objTemp to a file so I can load back up the same instance of my dll and continue using it. Any ideas on how to do that... both storing, and while you're at it, loading back up? Thanks
Tim
RManzione
Dec 8th, 2000, 12:47 AM
I'm not sure I understand what you are trying to do. Are you trying to store certain properties of the class? If so, you can use the PropertyBag object.
Regards,
tmatbeam
Dec 8th, 2000, 08:08 AM
Hi,
no... I've used the property bag before. I'm referring to something slightly different. I'm creating an instance of a COM dll.
Dim objTemp As Object
Set objTemp = CreateObject("something.something")
now I will do some methods on that dll.
after that I want to be able to somehow store the instance of this dll. writing the object (objTemp) somehow to a binary file would be best for my application, but I'm not sure its possible. if I could do that I could at a later date suck back in the object (instance of the COM dll) for further use. any ideas?
Tim
phinegeek
Dec 9th, 2000, 01:02 AM
for some reason i dont think that what you are trying to do is actually possible. however, i can think of a way to work around this. save your method values or whatever to some physical file before you destroy the object. then the next time you need to use that type of object you can "suck" those values into that object. you cannot (i don't think) instantiate an object, save the actual object for later use and destroy it.. then "suck" it back into the same exact state it was in before you destroyed it.. once its destroyed, its destroyed.
tmatbeam
Dec 11th, 2000, 08:51 AM
I was afraid of that :\
I was trying to get away from actually storing each item in a data file, but I figured it was probably the only way.
Is there a way in C++? I thought I heard of something that allowed you to dump your dll instance from memory to a file. I could be fantasizing, though. Thanks
Tim
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.