9 Jun
2003
9 Jun
'03
08:43
Hi, I'm creating a C++ wrapper to API written in C. One of the C function takes a pointer to function as an argument: cfunction(int (*callback)(int, *char[])); The wrapper uses a pure virtual function: class Process { public: virtual int run(int i, *char[]) = 0; }; Problem is, how to "convert" run to "callback"? I've tried cfunction(&Process::run), but g++ keeps complaining: cannot convert `int (Process::*)(int, char**)' to `int (*)(int, char**)' for argument `2' to `s_m_process* MSG_process_create(const char*, int (*)(int, char**), void*, s_m_host*)' -- -- Verdi March --