How to get the array of struct with “byte array” from WinRT C++ to C# in Windows Store app?

前端 未结 1 407
终归单人心
终归单人心 2021-01-12 23:15

Here I have a C# metro app with a C++ WinRT component. I need to do something in WinRT, like assign a photo\'s name/path, and retrieve photo\'s thumbnail.

First, I w

相关标签:
1条回答
  • 2021-01-12 23:22

    The following array types can be passed across the ABI:

    1. const Platform::Array^,
    2. Platform::Array^*,
    3. Platform::WriteOnlyArray,
    4. return value of Platform::Array^.

    A value struct or value class can contain as fields only fundamental numeric types, enum classes, or Platform::String^.

    So you cannot use a value struct with arrays. And you cannot use arrays of uint8[] type.

    You should pass arrays and structs separately or by using a ref class.

    0 讨论(0)
提交回复
热议问题