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).
COM 支持连接点对象的啊,功能类似回调函数。 继承 IDISPATCH 做一个出接口就行了,很方便的
问题是我没有办法得到ATL生成的类指针。
继承 IDISPATCH 做一个出接口就行了,很方便的
-----------------------------------------------------------
我看明白你的意思了。这个很简单。你可以声明一个全局的类指针,然后在你动态生成的时候,把这个全局的类指针给赋值一下.你的静态函数可以很方便的访问到这个全局变量,如果为非NULL,则可以用它来FireEvent了.;)