*Urgent* error C2664: cannot convert parameters...

Hi anybody can help me how to solve this.

in aw.h (created by 3rd party developer)

AWAPI int aw_instance_event_set (AW_EVENT_ATTRIBUTE a, void (*handler) (void));

in whiteboard.cpp

class whiteboardbot{
public:
void object_add(void);
typedef void (whiteboardbot::*FuncPtr)(void);
};

void whiteboardbot :: object_add (void)
{
....
}

in welcomeworld.cpp

int main (int argc, char *argv[]){
whiteboardbot::FuncPtr ptr;
ptr = &whiteboardbot::object_add;


/* install whiteboard for whiteboardbot_add event */
aw_event_set (AW_EVENT_OBJECT_ADD, ptr);
...
}

Error: cannot convert from cannot convert parameter 2 from 'whiteboardbot::FuncPtr' to 'void (__cdecl *)(void)

Hope to hear your reply soon..
cheers,
ezra
aw_event_set() takes a function pointer pointing to a function that looks like this:

void func();

However, you are passing it a member function, which is not the same.
hihi firedraco,

Thanks for reply... i could not get what you mean... ' cos i am a beginner of c++ programming. So can you kindly give me a example of

aw_event_set() takes a function pointer pointing to a function that looks like this:

void func();

sorry for troubling you... =(

Topic archived. No new replies allowed.