serializing a COM object

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • craig.wenger@gmail.com

    #1

    serializing a COM object

    Is it possible to serialize a COM class for which you don't have the
    source code? Obviously it won't work without the [Serializable]
    attribute, which I can't add, and implementing ISerializable on a
    derived class won't help because I don't have access to the private
    fields that I would need to write to a file for the serialization to
    be successful.

    Is there a way to write the block of memory from a pointer? I could
    use Marshal.Structu reToPtr() to get a pointer to the object and
    Marshal.SizeOf( ) to determine how much memory it takes up, and write
    all of that to a binary file.

  • Sheng Jiang[MVP]

    #2
    Re: serializing a COM object

    There are a lot of persistance COM interfaces , see
    http://msdn2.microsoft.com/en-US/library/aa768185.aspx for more information.
    --
    Sheng Jiang
    Microsoft MVP in VC++
    <craig.wenger@g mail.comwrote in message
    news:1184810237 .425479.51160@i 38g2000prf.goog legroups.com...
    Is it possible to serialize a COM class for which you don't have the
    source code? Obviously it won't work without the [Serializable]
    attribute, which I can't add, and implementing ISerializable on a
    derived class won't help because I don't have access to the private
    fields that I would need to write to a file for the serialization to
    be successful.
    >
    Is there a way to write the block of memory from a pointer? I could
    use Marshal.Structu reToPtr() to get a pointer to the object and
    Marshal.SizeOf( ) to determine how much memory it takes up, and write
    all of that to a binary file.
    >

    Comment

    Working...