title: MFC Ribbon - get base element clicked from command
body: <p>I have a CMFCRibbonUndoButton on the ribbon of an MFC application.  I have a handler for when its ID is clicked (<code>ON_COMMAND(ID_EDIT_UNDO, ...)</code>).  However, when the button is also in the quick access toolbar (QAT), there are apparently two CMFCRubbonUndoButtons which each keep their own state.  In the command handler, I don't know how to tell which got clicked, and if you call <code>GetActionNumber()</code> on the wrong one, you get the wrong number of undo actions returned.</p>
  
  <p>Is there a way in my <code>ON_COMMAND</code> handler to get the <code>CMFCRibbonBaseElement*</code> that fired the event?</p>
  
  <p>Edit: the answer is important to me, the question is a bit obscure but I'm putting a bounty up!</p>
  
  <p>Edit: here's how it's added to the QAT:</p>
  
  <pre><code>CList&lt;UINT, UINT&gt; lstQATCmds;
  lstQATCmds.AddTail(ID_EDIT_UNDO);
  m_RibbonBar.SetQuickAccessCommands(lstQATCmds);
  </code></pre>