Heike Posted January 7, 2003 Posted January 7, 2003 Has anyone ever had that error message? What may be wrong? Quote
*Experts* Nerseus Posted January 7, 2003 *Experts* Posted January 7, 2003 What context? What's the code you're running (and the other code that initiates it)? -Nerseus Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Heike Posted January 8, 2003 Author Posted January 8, 2003 That's not easy to answer.... I'm developing an AddIn for Word2000 There everything works fine. Additional to that I have a simple EXE. This EXE opens word and then uses my AddIn. Two of my forms causes the described error. Therefore I'm not sure, if any code would help. My guess is, that it may be caused by the toolbar which is on both forms. I have other forms within my AddIn which have no toolbar and those forms all work. Heike Quote
Heike Posted January 8, 2003 Author Posted January 8, 2003 Maybe this can help anyone to give me a hint... The original message is: ************** Exception Text ************** System.InvalidOperationException: DragDrop registration failed. ---> System.Threading.ThreadStateException: The current thread must set to Single Thread Apartment (STA) mode before OLE calls can be made. Ensure that your Main function has STAThreadAttribute marked on it. Quote
*Experts* Nerseus Posted January 8, 2003 *Experts* Posted January 8, 2003 By context, I mean what is it you're developing? Is this something that supports DragDrop (by your original message header) or is it something to do with OLE Automation? And when does your error occur? As soon as your object loads or some time later, during an event or method call? -Nerseus Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Heike Posted January 8, 2003 Author Posted January 8, 2003 It seems like I solved the problem a few minutes ago. I set the property AllowDrop of my toolbar to FALSE and until now the error hasn't occured any more... Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.