Title: Bericht

Thanks for the info!

 

Jacques

 

-----Oorspronkelijk bericht-----
Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Namens John Lam
Verzonden: Friday, November 18, 2005 3:25 AM
Aan: Discussion of IronPython
Onderwerp: Re: [IronPython] Problem: AllowDrop = True --> DragDropregistrationfailed

 

MTA is default due to a change in the behavior of the Whidbey CLR.

 

In earlier versions of the CLR, CoInitializeEx was not called in *most* cases. So you could tell your thread to enter an STA via a change to ApartmentState in *most* cases. The default in Whidbey is to put all threads in the MTA which is more predictable, even at the expense of breaking applications that manually set the ApartmentState of a thread after execution has started.

 

You must declare the COM requirements of the startup thread via an STAThread attribute in your application’s Main() method. I’m not sure how attributes are supported in IP (I’ve run into this problem in my Ruby bridge – and have a non-ideal solution to it as well).

 

HTH,

-John

http://www.iunknown.com

 

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of J. de Hooge
Sent: Thursday, November 17, 2005 9:00 PM
To: users@lists.ironpython.com
Subject: [IronPython] Problem: AllowDrop = True --> DragDrop registrationfailed

 

Hi,

 

In the past months I've been coding quite extensively using previous versions of IronPython (upto 0.9.3) and the .NET 2.0 framework beta.

One of the things I've been using a lot is drag&drop.

 

Recently I've downloaded IP 0.9.5 and the "final" .NET 2.0 distribution.

Setting the AllowDrop property of e.g. a Forms.ListView to True now results in an exception message: DragDrop registration failed.

 

From the internet I've gathered that I should change the ApartmentState of my main thread to STA, using an attribute.

But how can I do that from IP? And why is MTA the default, causing this problem?

 

Or is there a different solution.

Any help appreciated.

 

Thanks

Jacques de Hooge

_______________________________________________
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to