[IronPython] Problem: AllowDrop = True --> DragDrop registration failed

Martin Maly Martin.Maly at microsoft.com
Fri Nov 18 04:26:10 CET 2005


Actually, I wonder if this is related to the recent change in IronPython. When debugging IronPython we found out that Visual Studio often complains about the aplication thread being marked as STA and not pumping messages and our investigations showed that the way to make Visual Studio happy was to remove the STAThread attribute from IronPython's Main and go with the default.

It creates an interesting class of problems, having the engine be marked one way, and the application running in it needing different apartment settings.

Could you try putting the STAThread attribute back on the IronPython Main and let me know if you got things working that way? I am interested to know what implications it may have to have the main IronPython thread marked either way.

thanks very much
Martin


________________________________

From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of J. de Hooge
Sent: Thursday, November 17, 2005 6:00 PM
To: users at lists.ironpython.com
Subject: [IronPython] Problem: AllowDrop = True --> DragDrop registration failed


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
info at geatec.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20051117/ac8489bc/attachment.html>


More information about the Ironpython-users mailing list