|
-
September 4th, 2002, 09:34 AM
#1
Get the address of a member function
Hi
I have a static structure with a member int (*repfn)(int state, const char * reply,int tout) – a function pointer.
I want to initialise the pointer within my dialog constructor to point to a member function of my dialog class.
Like this:
Code:
CEnterDiagnostics::CEnterDiagnostics() : CPropertyPage(CEnterDiagnostics::IDD)
{
//{{AFX_DATA_INIT(CEnterDiagnostics)
//}}AFX_DATA_INIT
StateMachine[0].repfn = OpenReply;
}
Where OpenReply is a member of my class CEnterDiagnostics and declared as
int OpenReply(int state, const char *pReply,int tout);
But it doesn’t work I get a compiler error
C2440: '=' : cannot convert from 'int (__thiscall CEnterDiagnostics::*)(int,const char *,int)' to 'int (__cdecl *)(int,const char *,int)'
Is there a way to do this?
Thanks
Alec
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|