[Python.NET] winForms, threading and dragdrop ?
guy at r-e-d.co.nz
Mon Sep 12 05:38:55 CEST 2005
From the attached code.With AllowDrop = True I get a .NET error as follows:
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.
From googling I need to set ApartmentState.STA. But this is readonly. How do I
set STA correctly in Python for .NET?
Any thoughts appeciated.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
More information about the PythonDotNet