C ++ Borland矢量事件

时间:2016-04-04 13:32:53

标签: c++ events callback

我有以下代码:

A.H

typedef bool __fastcall(__closure * Callback)();
class A
{
   private :

  Callback FCallback

   public:
    A(); 
    __property Callback OnCallBack = {read = FCallback, write = FCallback};
};

然后,在其他课程中我有:

 a = new A();
 a->OnCallback=b[1].getData; //b is the class called for callback. But not matter for the goal of this example.

我在这堂课中喜欢做的事情是:

 a = new A();
 a->OnCallback[1]=b[1].getData;

那么我如何在A类中声明属性以获得回调向量? 谢谢!

0 个答案:

没有答案