TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Charlie
NA
3
0
Clipboard access in BackgroundWorker
Jun 6 2008 5:23 PM
I have a C# 3.0 application that needs the GUI (WPF) to be constantly updated while doing a lot of work in the background. I solved that problem with a BackgroundWorker object. The BW works flawlessly, untill I try to get text from the Clipboard via System.Windows.Clipboard.GetText(); When I try to get anything from the clipboard object I get this error: "Current thread must be set to single thread apartment (STA) mode before OLE calls can be made." It is my understanding (could be wrong) that BackgroundWorkers are only MTA and cannot have an apartment set to them. And Application.OleReqired() does nothing either. So, my question is. Is there any sort of workaround to access COM object from a BackgroundWorker?
Reply
Answers (
2
)
Thread is not running?
Cloning a form?