
DCOM - transferring data to a remote computer
Quote:
>Hi,
>I am fairly new to this stuff, and am just beginning to learn a bit about
>ATL, COM and DCOM.
>Currenly I have a class which has several member variables, some of which
>are ints, bools, strings and
>arrays.
>I would ultimately like to transfer this class to another computer using
>DCOM.
>What I want to know is this:
>Should I create a property or method for each member variable in my class?
Never do this, the reason is that to access each piece of data you will have
to make a network call and this amount of calls will kill performance.
Quote:
>Or could I transfer my class
>as a liner buffer and cast it back to the class on the other computer? What
>is the best way to do this?
If you want to use type library marshalling then you could use IRecordInfo
to pass essentially a VB user designed type. Another option is to create an
object with read/write propertie and marshal this object by value as a
parameter to your method - ADO disconnected record sets and COM error
objects are passed across the network in this way. (I would favour this
method.)
Just as a plug, MSDN Magazine will have an article in a couple of months
time by me called "Data Transfer using COM on Windows 2000". I cover these
issues there and give some recommendations about data packet sizes.
Richard
--
www.idevresource.com