佚名通过本文主要向大家介绍了activex控件下载,activex控件下载xp,activex控件,activex控件被阻止,activex等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com
问题: 请问,ActiveX和DLL利用回调通讯,如何在回调中产生事件?
描述:
解决方案1:
描述:
我的问题是这样的,我要调用一个DLL进行一些工作,调用和返回不在一个线程中。所以我使用回调函数的方法返回数据。联系DLL的是一个ActiveX控件,因为我使用了回调函数,所以我必须向DLL提供一个静态函数地址。而我要在这个回调函数中产生一个事件,ATL的事件是在类中生成的,我无法在静态函数中调用。请大家帮帮忙。急!或者告诉我类似的可以解决ActiveX异步调用DLL返回数据并且可以产生事件的办法。
解决方案1:
You can use an IDispatch parameter instead of a callback function (in other words, event handler), and call IDispatch::Invoke to call the function (in other words, fire the event), which calls your function indirectly in its implementation. A typical example is AJAX (Asynchronous JavaScript and XML).