COM Interface as a param of WinRT ref class, how it possible?

爱⌒轻易说出口 提交于 2019-12-11 11:26:09

问题


How I can define this class correctly:

public ref class WICBMP sealed
{
  void Load(IWICBitmapSource ^wicBitmapSource);
};

回答1:


This is not possible. Only Windows Runtime types may be used when declaring members of a Windows Runtime interface (in this specific case, the compiler will need to generate an interface that declares your Load member function). You can't even do this if you try to define the interface in IDL.

A runtime class can implement COM interfaces that are not Windows Runtime interfaces, though. For example, see IBufferByteAccess (a COM interface), which all IBuffer (a Windows Runtime interface) implementations must implement.



来源:https://stackoverflow.com/questions/13310510/com-interface-as-a-param-of-winrt-ref-class-how-it-possible

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!