-
Hi, I have an object that implements the The problem is, I don't know of a good way to extract the I've read about Is there a better, more AOT friendly way to make this work? Thank you! In case it's necessary, this is the use case: unsafe void Method(Stream theStream)
{
IThingThatConsumesIStream *thatThing = // Assume that I instanced this and it's working.
// Now, we need to pass the stream to the consumer.
using StreamComWrapper wrapper = new(theStream);
IStream* comStream = wrapper.ToIStream(); // <-- This is where GetComInterfaceForObject comes in.
thatThing->DoTheThing(comStream); // <-- Requires an IStream*, not my interface, so I can't change it.
thatThing->Release();
} |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Well, I worked around this by writing my own com wrapper using the |
Beta Was this translation helpful? Give feedback.
Well, I worked around this by writing my own com wrapper using the
ComWrappers
type (not as brutal as that "tutorial" on Microsoft's site made it seem) and providing my own implementation to CsWin32'sIStream.Interface
. Seems to be working thus far, and AOT seems to be happy with it.