title: How can I call a function in C++ when I get the WinRT/UWP error 'Activating a single-threaded class from MTA is not supported?'
body: <p>When attempting to call a single-threaded apartment (STA) function from the "wrong" thread (<em>e.g.</em>, <code>Clipboard::SetContent(...)</code>), I see the following message:</p>
  
  <blockquote>
    <p>Activating a single-threaded class from MTA is not supported.</p>
  </blockquote>
  
  <p>It's not obvious which functions are STA, so it just seems to jump out from seemingly innocent-looking functions. I couldn't find a simple answer that explains the steps to fix it. The Windows COM documentation is difficult to follow.</p>
  
  <p>How can I reliably identify what is a STA function in order to prevent this error? Isn't there a simple fix?</p>