473,408 Members | 2,813 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 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 2103
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

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

Similar topics

0
by: Dennis | last post by:
Greetings, I am having a wierd problem with .net accessing the clipboard on certain machines. The code copies the RTF formatted data from the clipboard. I first try and retrieve the clipboard...
4
by: Joshua Campbell | last post by:
I am working on an application that needs to parse out data that has been copied into the clipboard. My first questions are how can I detect if the clipboard is empty, and how can I empty the...
3
by: Scott Friedrich | last post by:
Hi group I am using a 3rd party AX control in a VB.NET application. One of the methods of this control is to capture the current map within the control to the windows clipboard as .WMF. I am...
2
by: fred | last post by:
I am trying to Copy and paste using a custom format but I canot retrieve the data. In the main Form's class I have declared: Dim myDocmanFormat as DataFormats.Format then in the New Sub of...
7
by: lgbjr | last post by:
Hello All, I¡¯m using a context menu associated with some pictureboxes to provide copy/paste functionality. Copying the image to the clipboard was easy. But pasting an image from the clipboard...
6
by: Ed Bitzer | last post by:
Appreciate some help. Want to continuously check clipboard and if text present unhide and display in a text. The following code can find nothing in the clipboard even though I paste information...
5
by: dmeglio | last post by:
I have an item that I placed on the clipboard as follows: Clipboard.SetDataObject(slide); slide is type SlideType. Now I'm trying to read the data from the clipboard doing: foreach...
3
by: NoDozing | last post by:
Trying load an embedded object to the clipboard and then save it to a file. When I try and save to the file, I'm getting a "Object reference not set to an instance of an object". I've marked the line...
7
by: Newbie | last post by:
How do I clear the clipboard in VB.NET 2003? TIA Newbie
5
by: Max2006 | last post by:
Hi, No matter what I have in clipboard Clipboard.GetDataObject(); returns null. I suspect it might be a problem with Vista or VS2008 IDE debug mode problem? Is there any way to track why the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.