Re:Using a PropertyBag-like object - persistance of com objects
Quote
> Is it generalisable to an entire set of objects ?
Marshal-by-value can be used for any persistent object. The idea is to save
object's state during the marshaling process, create a new object during
unmarshaling and initialize it with a saved state. As a result, the client
won't get a proxy to the object, but a clone of an original object acting as
a proxy.
For more theory, surf to March 97 MSJ and read
http://www.microsoft.com/msj/defaultframe.asp?page=/msj/0397/ActiveX/...
0397.htm from Don Box.
While reading that, be aware that because you object will act as a proxy,
its threading model should be 'Both'.
Also read comments at http://www.develop.com/dbox/msj/0397.htm
Quote
> And can it be a "extern" mecanism, that is able to use it with COM objects
made in any language (VB)?
Unfortunately, custom marshaling requires participation on the object side
(it must implement IMarshal). While you can play with it a little by
aggregating the object, VB objects do not support aggregation.
But Don Box has an answer to this as well. Read these articles:
http://www.microsoft.com/msj/defaultframe.asp?page=/msj/0399/com/com0...
http://www.microsoft.com/msj/defaultframe.asp?page=/msj/0199/intercep...
cept.htm
http://www.microsoft.com/msj/defaultframe.asp?page=/msj/0299/intercep...
rcept2.htm
Anything you wanted to know about by-value marshaling (and much more) is
there.