Clipboard.GetDataObject()

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • asmapanjabi
    New Member
    • Jan 2008
    • 10

    Clipboard.GetDataObject()

    am using C#.net 1.1 while using clipboard m geeting this exception
    System.Threadin g.ThreadStateEx ception: Current thread must be set to single thread apartment (STA) mode before OLE calls can be made. Ensure that your Main function has STAThreadAttrib ute marked on it.
    at System.Windows. Forms.Clipboard .GetDataObject( )
  • asmapanjabi
    New Member
    • Jan 2008
    • 10

    #2
    Originally posted by asmapanjabi
    am using C#.net 1.1 while using clipboard m geeting this exception
    System.Threadin g.ThreadStateEx ception: Current thread must be set to single thread apartment (STA) mode before OLE calls can be made. Ensure that your Main function has STAThreadAttrib ute marked on it.
    at System.Windows. Forms.Clipboard .GetDataObject( )

    i have made an entry for Main as
    [STAThread]
    public static void Main()
    still m getting the exception

    Comment

    • Plater
      Recognized Expert Expert
      • Apr 2007
      • 7872

      #3
      Are you running any other threads in your project?
      Background workers?
      Timers?

      Comment

      Working...