callback function
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?
this question gets asked an aweful lot
Look through some previous post, i forgot the answer unfortunetly
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
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
October 03, 2000 01:42 AM
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
Popular Topics
Advertisement
Recommended Tutorials
Advertisement