我用dotnetmagic库,并创建了一个可停靠的窗口,从IDE (VS2005)运行时的作品,但是当我使用的可执行程序,它抛出一个异常曰:System.InvalidOperationException在VS 2005
System.InvalidOperationException: DragDrop registration did not succeed. --->
System.Threading.ThreadStateException: Current thread must be set to single
thread apartment (STA) mode before OLE calls can be made. Ensure that
your Main function has STAThreadAttribute marked on it.
at System.Windows.Forms.Control.SetAcceptDrops(Boolean accept)
--- End of inner exception stack trace ---
at System.Windows.Forms.Control.SetAcceptDrops(Boolean accept)
at System.Windows.Forms.Control.OnHandleCreated(EventArgs e)
at System.Windows.Forms.Control.WmCreate(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.UserControl.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(
IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
如何去掉这些东西,谁能帮我解决这个问题?
-1,如果你读了这是给你的很有帮助消息你可能会自己解决这个问题 – 2010-07-06 11:57:31