C库和C#GUI之间的事件处理

编程入门 行业动态 更新时间:2024-10-12 08:17:53
本文介绍了C库和C#GUI之间的事件处理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

您好,我目前正在编写一个GUI,该GUI调用C H.264视频解码器库.我想在解码器完成一帧解码并更新缓冲区后立即停止解码器,然后从C#GUI中读取此缓冲区,然后显示该缓冲区. 我怎样才能做到这一点? ,关于C和C#之间的事件处理的信息并不多.有人可以帮我解决这个问题吗,我迫切需要一个解决方案,期限将至. 谢谢

Hi currently I am writing a GUI which calls a C H.264 video decoder library. I want to stop the decoder as soon as it finishes decoding one frame and updating a buffer and then read this buffer from C# GUI and then display the same. How can I achieve this? , not much information is present on event handling between C and C#. Can someone help me out with this, I desperately need a solution, deadlines approaching. Thanks

推荐答案

如果您的意思是C,而不是带有COM的C ++,则事件不是其方法论的一部分.可中断的线程或方法也不是.我建议您将做一帧"功能直接暴露给外部(即C#库可以调用它),并管理调用该函数并在C#端读取结果的可中断循环(可能在后台线程中.) If you mean C, and not for example C++ with COM, events are not part of its methodology. Nor are interruptible threads or methods. I''d recommend that you expose the ''do one frame'' function directly to the outside (i.e. so the C# library can call that), and manage the interruptible loop of calling that function and reading the result in the C# side (in a background thread, probably).

更多推荐

C库和C#GUI之间的事件处理

本文发布于:2023-11-12 11:06:25,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1581318.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:事件   GUI

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!