title: STA, MTA and OLE nightmare
body: <p>I have to include a .NET application into another .NET application as a plugin. The plugin interface requires me to inherit from a template form. The form is then attached in a MDI when the plugin is loaded.</p>
  
  <p>Everything is working so far, but whenever I register for drag and drop events, set the autocomplete mode for a combobox or at various other situations I get the following exception:</p>
  
  <blockquote>
    <p>...the current thread must be set to
    single thread apartment (STA) mode
    before OLE calls can be made. Ensure
    that your Main function has
    STAThreadAttribute marked on it...</p>
  </blockquote>
  
  <p>The main application is running in MTA and developed by another company, so there is nothing I can do about it. </p>
  
  <p>I tried to do the things that cause these exceptions in STA threads, but that didn't solve the problem either. </p>
  
  <p>Has anyone been in the same situation? Is there anything I can do to solve the problem?</p>