无法将字节数组从 UWP C# 组件传递到 WinRT C++成分

发布于 2025-01-19 13:43:14 字数 458 浏览 1 评论 0原文

我正在尝试在WinRT C ++组件中渲染图像数据,因此我将一个字节数组从UWP组件传递给WinRT组件。 但是IDL不支持字节*

streamSamplepool.cpp

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

streamSamplepool.h

void HandleFrameData(BYTE* pData);  

这是没有任何问题的编译,但是问题是我们想在IDL文件中定义此问题时不支持指针,另外也尝试使用无符号字符的Ivector/数组,但这似乎也不支持IDL文件中的支持。如何将字节数组从UWP组件传递到WinRT组件? 从C#传递字节数组的任何示例段,IDL文件中的定义都会有所帮助

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文