I'm trying to attach a custom CCW to a managed object using Marshal.CreateAggregatedObject. This works fine. The problem is that I can't cast back to the managed object after a reference has been passed to COM and then passed back to managed code. The
object is only identified as ComObject. Some research led me to interface IManagedObject. I've added that to the CCW but I'm not able to implement it correctly. Specifically, the method GetObjectIdentity is the problem. I don't know how to correctly fill in
the returned values for GUID and CCW. So my question is, how do I configure a custom CCW so that I can get back to the managed object when a COM reference is passed back into managed code? The documentation is incomplete.
↧