468,741 Members | 1,576 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,741 developers. It's quick & easy.

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 1897
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
xarzu
2 posts views Thread by xarzu | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.