How can I pass a class member function as a callback?

前端 未结 12 1755
忘掉有多难
忘掉有多难 2020-11-22 04:58

I\'m using an API that requires me to pass a function pointer as a callback. I\'m trying to use this API from my class but I\'m getting compilation errors.

Here is

12条回答
  •  误落风尘
    2020-11-22 05:38

    I can see that the init has the following override:

    Init(CALLBACK_FUNC_EX callback_func, void * callback_parm)
    

    where CALLBACK_FUNC_EX is

    typedef void (*CALLBACK_FUNC_EX)(int, void *);
    

提交回复
热议问题