title: How do you pass a member function pointer?
body: <p>I am trying to pass a member function within a class to a function that takes a member function class pointer.  The problem I am having is that I am not sure how to properly do this within the class using the this pointer.  Does anyone have suggestions?</p>
  
  <p>Here is a copy of the class that is passing the member function:</p>
  
  <pre><code>class testMenu : public MenuScreen{
  public:
  
  bool draw;
  
  MenuButton&lt;testMenu&gt; x;
  
  testMenu():MenuScreen("testMenu"){
      x.SetButton(100,100,TEXT("buttonNormal.png"),TEXT("buttonHover.png"),TEXT("buttonPressed.png"),100,40,&amp;this-&gt;test2);
  
      draw = false;
  }
  
  void test2(){
      draw = true;
  }
  };
  </code></pre>
  
  <p>The function x.SetButton(...) is contained in another class, where "object" is a template.</p>
  
  <pre><code>void SetButton(int xPos, int yPos, LPCWSTR normalFilePath, LPCWSTR hoverFilePath, LPCWSTR pressedFilePath, int Width, int Height, void (object::*ButtonFunc)()) {
  
      BUTTON::SetButton(xPos, yPos, normalFilePath, hoverFilePath, pressedFilePath, Width, Height);
  
      this-&gt;ButtonFunc = &amp;ButtonFunc;
  }
  </code></pre>
  
  <p>If anyone has any advice on how I can properly send this function so that I can use it later.</p>