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
Printable View
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
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
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