C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

member function adresses

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language (comp.lang.c++)
View previous topic :: View next topic  
Author Message
Kevin Joplin
Guest





PostPosted: Mon Oct 27, 2003 12:41 pm    Post subject: member function adresses Reply with quote



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:homeKrychuprojectsGameNameInputCExample.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
Back to top
Antonio
Guest





PostPosted: Mon Oct 27, 2003 12:56 pm    Post subject: Re: member function adresses Reply with quote



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



Back to top
Karl Heinz Buchegger
Guest





PostPosted: Mon Oct 27, 2003 1:09 pm    Post subject: Re: member function adresses Reply with quote





Kevin Joplin wrote:
Quote:

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

This is in the FAQ

http://www.parashift.com/c++-faq-lite/

see section 33

Quote:
regards
Kevin

--
Karl Heinz Buchegger
[email]kbuchegg (AT) gascad (DOT) at[/email]

Back to top
Kevin Joplin
Guest





PostPosted: Mon Oct 27, 2003 1:47 pm    Post subject: Re: member function adresses Reply with quote

Hi,
thanks for all your help!
Kevin
Back to top
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language (comp.lang.c++) All times are GMT
Page 1 of 1

 
 


Powered by phpBB © 2001, 2006 phpBB Group