auto streaming COM objects

Hi all,

I was wondering what would be the best way of automatically saving a COM
object to a stream and then subsquently restoring that COM object at some
later point? I realise I could write an IPersistStream interface for each COM
object manually, but I could have close to a hundred of these COM objects in
the application I am writing and I would strongly prefer to only have to do
this once.

I know you can use the COM objects to iterate through all of the properties,
but then you have to write the code to check the type of each property, write
the code to stream that property type out and restore it later, etc. Now I
know for Delphi objects all of this functionality is available, however does
similar functionality exist in the COM world or will I be forced to roll my
own?

Cheers,

Gerald

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own