Click here to Skip to main content
15,891,951 members
Home / Discussions / C#
   

C#

 
QuestionNew Message window loses focus when launched via Simple MAPI Pin
cobra200517-Nov-06 7:35
cobra200517-Nov-06 7:35 
QuestionNames of Tables for ListBox Pin
Blekk17-Nov-06 7:27
Blekk17-Nov-06 7:27 
AnswerRe: Names of Tables for ListBox Pin
Robert Rohde17-Nov-06 12:20
Robert Rohde17-Nov-06 12:20 
AnswerRe: Names of Tables for ListBox Pin
Noman Nadeem17-Nov-06 21:52
Noman Nadeem17-Nov-06 21:52 
QuestionMinimize / Restore a WinForm programmatically Pin
spin vector17-Nov-06 6:46
spin vector17-Nov-06 6:46 
AnswerRe: Minimize / Restore a WinForm programmatically Pin
mav.northwind17-Nov-06 6:49
mav.northwind17-Nov-06 6:49 
GeneralRe: Minimize / Restore a WinForm programmatically Pin
spin vector17-Nov-06 7:12
spin vector17-Nov-06 7:12 
QuestionRead Win Clipboard inside a thread Pin
MaxRelaxman17-Nov-06 5:48
MaxRelaxman17-Nov-06 5:48 
I have a thread running that needs to read the Windows Clipboard but my Clipboard.GetDataObject() always returns null. I've read that Clipboard.GetDataObject() doesn't work in a thread (even though it's supposed to be thread safe), so I tried setting the apartment state by doing Thread.SetApartmentState(ApartmentState.STA) and still no luck. Anyone have any ideas I can try? The Main() function is declared with [STAThread] and I've even tried using [STAThread] to declare the function that tries to read the clipboard.

Here's the background on the thread:
The thread imports data from various formats (Excel, CSV, DBF, MDB, and I"m trying to get Word working) into a database. The best way I've seen to read Word Docs is to open the doc by creating a Word Application class, opening the doc in question, having word select severything and copy it to the clipboard.

I'm running WinXP pro and Word 2007 (wasn't having much luck in the previous version of Word either)

Here's the code that I use to call the thread:
m_ProcessThread = new Thread(new ParameterizedThreadStart(this.RunJob));<br />
m_ProcessThread.SetApartmentState(ApartmentState.STA);<br />
m_ProcessThread.Start(NextUp);<br />
m_JobList.Sort();<br />
m_JobList.ResetNextUp();<br />
UpdateJobListView();


And here's my clipboard reader (straight from MSDN)
IDataObject iData = Clipboard.GetDataObject();


Thanks!
AnswerRe: Read Win Clipboard inside a thread Pin
mav.northwind17-Nov-06 6:47
mav.northwind17-Nov-06 6:47 
GeneralRe: Read Win Clipboard inside a thread Pin
MaxRelaxman17-Nov-06 9:23
MaxRelaxman17-Nov-06 9:23 
Questiondynamic data structures Pin
Todd Smith17-Nov-06 4:47
Todd Smith17-Nov-06 4:47 
AnswerRe: dynamic data structures Pin
ednrgc17-Nov-06 4:49
ednrgc17-Nov-06 4:49 
GeneralRe: dynamic data structures Pin
led mike17-Nov-06 5:02
led mike17-Nov-06 5:02 
AnswerRe: dynamic data structures Pin
J4amieC17-Nov-06 5:28
J4amieC17-Nov-06 5:28 
GeneralRe: dynamic data structures Pin
ednrgc17-Nov-06 7:06
ednrgc17-Nov-06 7:06 
GeneralHTML Editor Control Advice Pin
Brady Kelly17-Nov-06 4:42
Brady Kelly17-Nov-06 4:42 
GeneralRe: HTML Editor Control Advice Pin
Ed.Poore17-Nov-06 6:39
Ed.Poore17-Nov-06 6:39 
GeneralRe: HTML Editor Control Advice Pin
Brady Kelly19-Nov-06 18:09
Brady Kelly19-Nov-06 18:09 
GeneralRe: HTML Editor Control Advice Pin
Ed.Poore19-Nov-06 20:22
Ed.Poore19-Nov-06 20:22 
GeneralRe: HTML Editor Control Advice Pin
Brady Kelly19-Nov-06 21:14
Brady Kelly19-Nov-06 21:14 
GeneralRe: HTML Editor Control Advice Pin
Ed.Poore19-Nov-06 21:30
Ed.Poore19-Nov-06 21:30 
GeneralRe: HTML Editor Control Advice Pin
Brady Kelly19-Nov-06 21:44
Brady Kelly19-Nov-06 21:44 
GeneralRe: HTML Editor Control Advice Pin
Ed.Poore20-Nov-06 0:56
Ed.Poore20-Nov-06 0:56 
QuestionClosing Console Window without Closing Application Window Pin
jackie83sg200517-Nov-06 3:43
jackie83sg200517-Nov-06 3:43 
AnswerRe: Closing Console Window without Closing Application Window Pin
Karthik Kalyanasundaram17-Nov-06 4:17
Karthik Kalyanasundaram17-Nov-06 4:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.