将数据从dll发送回.exe

编程入门 行业动态 更新时间:2024-10-27 14:34:50
本文介绍了将数据从dll发送回.exe的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在开发基于插件的应用程序,并且需要在发生事件时将数据(字符串,数组)发布回我的主EXE。我不太清楚如何去做,我已经考虑过在主应用程序中创建一个线程,这个线程会持续调用DLL中的一个方法来寻求数据,但是这似乎是非常低效的,有没有一些事件监听器使用这个?

I am developing a plug-in based application and need to be able to post data (strings, arrays) back to my main EXE when something happens. I'm not quite sure how to go about this, I have thought about creating a thread in the main application that would continuously call a method in the DLL asking for data but this seems very inefficient, is there some sort of event listener I could use for this?

谢谢。

推荐答案

加载机制的插件DLL,您可以传入一个类对象/函数指针/委托/事件,DLL可以用来通知主应用程序插件生成的任何事件。

As part of the loading mechanism for the plug-in DLLs, you could pass in a class object / function pointer / delegate / event that the DLL can use to inform the main application of any events the plug-in generates.

更多推荐

将数据从dll发送回.exe

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

发布评论

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

>www.elefans.com

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