winprt

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

六月ゝ 毕业季﹏ 提交于 2019-12-04 01:24:19
问题 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 write a value struct and retrieve struct array function in WinRT C++ as below. public value struct Item { String^ strName; String^ strPath; }; public ref class CTestWinRT sealed { public: CTestWinRT(); void TestOutStructArray(Platform::WriteOnlyArray<Item>^ intOutArray) { intOutArray->Data[0].strName = ref new String(L"test1.jpg");

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

只愿长相守 提交于 2019-12-01 04:30:25
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 write a value struct and retrieve struct array function in WinRT C++ as below. public value struct Item { String^ strName; String^ strPath; }; public ref class CTestWinRT sealed { public: CTestWinRT(); void TestOutStructArray(Platform::WriteOnlyArray<Item>^ intOutArray) { intOutArray->Data[0].strName = ref new String(L"test1.jpg"); intOutArray->Data[0].strPath = ref new String(L"c:\\temp"); intOutArray->Data[1].strName = ref new