Click to See Complete Forum and Search --> : Reading VC++ Serialized data using VB


Lemonhead
July 22nd, 1999, 05:53 AM
Hello,

Does anyone know if its possible to use VB to read files that have been created using the Serialize mechanism provided in VC++?

Neil

July 22nd, 1999, 09:24 AM
Sure, but the VB programmer would need to know what data structures were serialized in VC++.

Lemonhead
July 22nd, 1999, 10:34 AM
Exactly my point. I'm not asking whether the VB language provides the facilities to read a binary file from disk - virtually any language will allow you to do that. I want to know if there is a higher level of support for doing this, i.e. how do I inform VB of my classes(types) - I can't just #include my header files - I suppose I have to make equivalent definitions (by hand) in VB, but even if I did that is there any support in VB for this binary file format? I doubt that there is, but there's a lot I don't know so I'm just asking the question.

Neil

Tomaz Stih
July 30th, 1999, 11:01 AM
The idea I can think of ( and I know not very helpful :-( ) is to use structured storage in VC++ ( write CStructuredStorageFile class and do special handling of every object you want to serialize - write signature of object in the form of BSTRs at the beginning of your object, use hierarchy for classes that contain other classes and use OLE types so you are compatible with VB )

Perhaps the signature functionallity could be added to every object by a simple macro
DECLARE_STRUCTSTORG_SERIAL and IMPLEMENT_STRUCTSTORG_SERIAL.

Tomaz

---------------------------------------------
Tomaz Stih, B.Sc.CS tomaz@nameco.com
Ob sotoccju 10 Nameco Group
SI-1000 Ljubljana http://www.nameco.com
Europe

Gary Grant
July 30th, 1999, 11:58 AM
If I were going to do this, I would write a standard windows or activex dll in C++ to read the CArchive
file and call that dll from VB