Can a managed ref-class directly implement a COM interface?
问题 Is there a built-in way to allow a managed ref-class to implement and expose a COM inerface that is safely callable from native code? Looking at the C# side, this is easily done by decorating the target interface with the proper COM-interop attributes, for example: Native Interface interface ISampleGrabberCB: public IUnknown { virtual STDMETHODIMP SampleCB( double SampleTime, IMediaSample *pSample ) = 0; virtual STDMETHODIMP BufferCB( double SampleTime, BYTE *pBuffer, long BufferLen ) = 0; };