Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DragDrop registration did not succeed. 1

Status
Not open for further replies.

haddaway

Programmer
Jul 6, 2005
172
SE
I am trying to implement drag'n'drop on a textbox in VS2005. When setting allowdrop to true I get an exception when loading the form:

DragDrop registration did not succeed.

InvalidOperationException.

Any ideas why?
 
It looks as though it may be a treading error. The first article I found on the subject was:


which lead to some people trying the following code:
Code:
System.Threading.Thread.CurrentThread.ApartmentState = System.Threading.ApartmentState.STA
but as I can't replicate the error, it's difficult to help further.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.
 
You are right. The problem is that I am not allowed to change to STA. The reason is probably because I do Application.Run at a later stage. Is it possible to pass the thread in some way or solve in any other way?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top