472,133 Members | 1,153 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,133 software developers and data experts.

Clipboard.GetDataObject()

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
2 2047
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
7,872 Expert 4TB
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.

Similar topics

4 posts views Thread by Joshua Campbell | last post: by
3 posts views Thread by Scott Friedrich | last post: by
2 posts views Thread by fred | last post: by
7 posts views Thread by lgbjr | last post: by
6 posts views Thread by Ed Bitzer | last post: by
5 posts views Thread by dmeglio | last post: by
7 posts views Thread by Newbie | last post: by
5 posts views Thread by Max2006 | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.