I am trying to create a function pointer to another function in c++.
This is what I have so far:
LONG (*function)(LPSTR,LPVIPERVAR4,LONG)=&CWilExtender::DllVarHandler;
When I try to compile my program, I get this error:
.\MyExtender.cpp(132) : error C2440: 'initializing' : cannot convert from
'LONG (__thiscall CWilExtender::* )(LPSTR,LPVIPERVAR4,LONG)' to
'LONG (__cdecl *)(LPSTR,LPVIPERVAR4,LONG)'
There is no context in which this conversion is possible
I don't know how the DllVarHandler was defined, and I don't know how to reproduce the type for the function pointer.
How do I change the (_cdecl *)
to match (__thisscall CWilExtender::*)
?
Specifically, what does LONG (__thiscall CWilExtender::* )(LPSTR,LPVIPERVAR4,LONG)
mean and how do I write that as the function pointer's type?
Thanks.