CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    May 1999
    Location
    Fort Worth Texas
    Posts
    614

    Passing classes to a COM/DCOM



    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

  2. #2
    Join Date
    Apr 1999
    Posts
    383

    Re: Passing classes to a COM/DCOM



    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

  3. #3
    Join Date
    Apr 1999
    Posts
    30

    Re: Passing classes to a COM/DCOM



    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured