Click to See Complete Forum and Search --> : Passing classes to a COM/DCOM


Jim Bassett
March 31st, 1999, 09:51 AM
I want to pass to a COM/DCOM component a class I have developed. So far I have not been able to do it, I am getting the impression I can't pass classes, or pointers to classes with COM/DCOM, am I doing something wrong?


Thanks


Jim Bassett

Dave Lorde
March 31st, 1999, 10:47 AM
If you don't want to get involved with custom marshalling (I would advise against it unless you have to), you need to convert your class data into simple types that standard COM marshalling can understand. If you make a struct containing the data, you should be able to pass it over in one lump and use it to construct a complementary object on the 'other side'.


You can't pass pointers with standard marshalling because the destination object may be in a different address space.


Dave

Santhosh Cheeran
April 1st, 1999, 12:16 AM
Adding to the answer, to convert to simple data type you can do a serialization of your class to a carchive, cretae ColeStreamfile pointer pass it and at the receiver end serialize it back to the object. Serialization converts into binary, right