title: Pass a member function as argument
body: <p>I have a Maya plugin and want to get events for timeChanges. However I need to pass a function that I don't want to be static, but this fail at compilation:</p>
  
  <pre><code>void MyClass::initializeCallbacks()
  {
      MDGMessage::addTimeChangeCallback((MMessage::MTimeFunction) &amp;timeChanged,this);
  }
  
  void MyClass::timeChanged(MTime tim, MyClass* clientData)
  {
      &lt;Code&gt;
  }
  </code></pre>
  
  <p>I then get the following compilation errors:</p>
  
  <pre><code>must explicitly qualify name of member function when taking its address
    ...&amp;timeChanged,this);
       ^~~~~~~~~~~~
        MyClass::
  error: cannot cast from type 'void (MyClass::*)(MTime,
        MyClass *)' to pointer type 'MMessage::MTimeFunction' (aka 'void
        (*)(MTime &amp;, void *)')
  </code></pre>
  
  <p>How can I properly pass a pointer of my function ?</p>