member function adresses

K

Kevin Joplin

Hi,
i have the following problem with getting member function adress:

class CExmaple {
public:
CExample();
~CExample();
void SetEventDispatch( void (* func)(const in_event_t *) );
void EventDispatch( const in_event_t *event );
};

CExample::CExample()
{
SetEventDispatch( EventDispatch );
}

//here goes implementation of other CExample member functions, i wont
//place them here for clarity.

i get error here... beceuse of pointers:

c:\home\Krychu\projects\GameName\Input\CExample.cpp(30): error C2664:
'CExample::SetEventDispatch' : cannot convert parameter 1 from 'void
(const in_event_t *)' to 'void (__cdecl *)(const in_event_t *)'

(i'm using vc++ .net 2003)

could someone give me a hint how to solve this problem ?
regards
Kevin
 
A

Antonio

try with
void SetEventDispatch( void (* EventDispatch::func)(const in_event_t *) );
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top