2

I'm trying to render image data in the WinRT C++ component, so I'm passing a byte array from the UWP component to the WinRT component. But IDL Doesn't support Byte*

StreamSamplePool.cpp

void StreamSamplePool::HandleFrameData(BYTE* frameData)
{
}

StreamSamplePool.h

void HandleFrameData(BYTE* pData);  

This is compiling without any issues but the problem is when we want to define this in the IDL file, IDL doesn't support pointers, alternatively tried using IVector/Array of unsigned char as well but that too doesn't seem to be supported in the IDL file. How do I pass the byte array from UWP Component to the WinRT Component? Any sample snippet of passing byte array from C# and definition in IDL file would be helpful

  • idl does supports pointers and BYTE*, for example: https://github.com/wmliang/wdk-10/blob/master/Include/10.0.10586.0/winrt/windows.storage.idl#L792 – Simon Mourier Apr 07 '22 at 12:04
  • In theory, there's a single, correct solution. Unfortunately, .NET is garbage, and that correct solution [cannot exist](https://github.com/microsoft/cppwinrt/pull/822). Which means the correct solution now is: Avoid .NET. Even if disguised behind the Windows Runtime contracts it cannot fulfill. – IInspectable Apr 07 '22 at 12:32

0 Answers0