You're trying to cast to (CDetour::*), which isn't a valid type definition. It is only a part of a member function pointer definition and doesn't make sense without the parameter list and return type. Look at the last line in the MS code example: &CMember::Target is the address of a member function pointer. You can only cast a member function pointer to a member function pointer of a differentsimilar type, in this case (void (CDetour::*)(void)), which is a member function of the class Detour (that is what CDetour::* means) with an empty parameter list (the (void) bit) and a void return type (the preceding void) The compiler error is based on the fact that the compiler doesn't recognize (CDetour::*) as part of a function pointer definition without the preceding return type, and there is no other valid interpretation. Your edit version looks better: the compiler does recognize the member function pointer cast correctly, it just doesn't want to accept that cast for some reason. One possible problem could be the calling convention being used: your class definition generated the member function using __thiscall, whereas the QT function was defined as using __cdecl. You may want to check your calling convention settings. [edit]fixed my statement about function pointer casts in light of what I said in the last paragraph[/edit]
GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto)