By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,107 Members | 1,209 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,107 IT Pros & Developers. It's quick & easy.

Clipboard.GetDataObject()

P: 10
am using C#.net 1.1 while using clipboard m geeting this exception
System.Threading.ThreadStateException: 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.
at System.Windows.Forms.Clipboard.GetDataObject()
Apr 8 '08 #1
Share this Question
Share on Google+
2 Replies


P: 10
am using C#.net 1.1 while using clipboard m geeting this exception
System.Threading.ThreadStateException: 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.
at System.Windows.Forms.Clipboard.GetDataObject()

i have made an entry for Main as
[STAThread]
public static void Main()
still m getting the exception
Apr 8 '08 #2

Plater
Expert 5K+
P: 7,872
Are you running any other threads in your project?
Background workers?
Timers?
Apr 8 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.