I think you have some problem in row
typedef void (MyClass::*StateFuncPtr)();
If you will post whole program I will try it.
Typedef is using to define own type name for existing typ.
For example:
typedef long int BigOnes;
BigOnes mynum = 0L;
you must use (this->*stateFuncPtr)(); instead of stateFuncPtr();
I don't know why you cann't call only by stateFuncPtr(). I think that this is syntax problem.
The answer is because every member function, by virtue of being a member function, has an implicit "this" pointer as its first parameter.
Attempting to call the member function via pointer, you must specify
which object you are calling the function on. Hence why (this->*f)().
Calling it like f() you are not telling the compiler which object you are
calling the member function on.