C库和C#GUI之间的事件处理 [英] Event handling between C library and C# GUI

查看:137
本文介绍了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之间的事件处理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆