J
Jakob Bengtsson
Hi,
I have a form (which cannot be serialized).
In the form's code I declare an object like this (never
mind the object nor class name, it's for illustration
only):
Private WithEvents eventPublisher as EventPublisherClass
When I try to serialize my eventPublisher object, I get an
error. It would seem, that the binary formatter I'm using
is trying to serialize all subscribers to the
eventPublisher's events, which in this case can't be done
(the subscriber is a form, which cannot be serialized).
Here's how I serialize the object
Dim f as new BinaryFormatter
Dim ms as new io.memorystream
try
f.serialize(ms, eventPublisher)
' Code here to persist the memory stream somewhere...
Catch ex as exception
stop
Finally
ms.close
End Try
Is there any way to serialize my eventPublisher?
Thanks for any help,
Jakob
I have a form (which cannot be serialized).
In the form's code I declare an object like this (never
mind the object nor class name, it's for illustration
only):
Private WithEvents eventPublisher as EventPublisherClass
When I try to serialize my eventPublisher object, I get an
error. It would seem, that the binary formatter I'm using
is trying to serialize all subscribers to the
eventPublisher's events, which in this case can't be done
(the subscriber is a form, which cannot be serialized).
Here's how I serialize the object
Dim f as new BinaryFormatter
Dim ms as new io.memorystream
try
f.serialize(ms, eventPublisher)
' Code here to persist the memory stream somewhere...
Catch ex as exception
stop
Finally
ms.close
End Try
Is there any way to serialize my eventPublisher?
Thanks for any help,
Jakob