Re: proxy/stub woes
While I don't claim to understand even a tenth of your
design, one thing I got clear is you don't use the data in
read-only mode as you expect data updates. Thus pure
MBV is not suitable for your situation. You actually
need what's called custom marshaling. E.g. implement
IMarshal on your object and have the client-side and
server-side objects communicate directly to exchange
the data. Then for example you can have the client-side
object periodically update itself in the background and
generate events (or be told to update and generates the
events as a result). The actual communication can take
whatever form you deem most appropriate, including
sockets, pipes, mailslots, shared memory, etc.
--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnickolov@mvps.org
MVP VC FAQ: http://vcfaq.mvps.org
=====================================
"Jason S" <jmsachs@gmail.com> wrote in message
news:1169673712.163500.181700@j27g2000cwj.googlegroups.com...
But when I use resync(), it takes about 15x the CPU as just getting a
fresh copy!
I'm not sure I understand why, in Don Box's "Essential COM" p. 208-211,
it sort of indicates that marshaling could be accomplished by using
CreateStreamOnHGLOBAL... how is regular marshalling able to set up the
stream & transfer data so much faster than I can if I do it manually?
Aha! I created a helper coclass which implements IStream on an
auto-expanding memory chunk, and had it marshal-by-value as well. So
when I resync(), I serialize the changes in my batch object into this
MBV memory chunk, transmit the memory chunk across apartments, and the
other apartment's batch object de-serializes the changes.
When I use the MBV memory chunk instead of the CreateStreamOnHGLOBAL
mess, then I get my resync() method to work quite nicely.