callback function

Started by
2 comments, last by Shian 23 years, 6 months ago
I have a callback function in my class, like this: class A { public: void setCallback(void (__cdecl *Callback)(int num)); private: void (__cdecl *CallbacFunction)(int num);//store the point } And I want to set a function in class to be the callback function. class B { public: B(){ a.setCallback(cbTest); } void __cdecl cbTest(int num); A a; } But it did not work! I have a error message : " cannot convert parameter 1 from ''void (int)'' to ''void (__cdecl *)(int) " How can I do?
Advertisement
this question gets asked an aweful lot
Look through some previous post, i forgot the answer unfortunetly
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
Someone can tell me where it is?
I always get error message,when i use "Search".

Microsoft OLE DB Provider for SQL Server error ''80040e31''
Timeout expired
/community/forums/Search.asp, line 61


You can''t do this with regular c-style function pointers. Look up the C++ FAQ Lite by Marshall Cline and you''ll find help on "member function pointers" and even a nice, helpful little macro.

This topic is closed to new replies.

Advertisement