COM Interface as a param of WinRT ref class, how i

2019-08-07 15:28发布

How I can define this class correctly:

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

1条回答
孤傲高冷的网名
2楼-- · 2019-08-07 16:09

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.

查看更多
登录 后发表回答