> AB->CreateButton(&rect, &tempfunction, 200, 200, 0);
...
> m_Button[ButtonCount].srcRect = pSrcRect;

Here's one problem.
Your class member variable is merely storing a pointer to something which is outside the class. If the external local variable goes out of scope you end up pointing to random bits of stack space being used by other local variables.

Classes should only have their own data or data which they themselves allocate.