DragDrop registration did not succeed. (摘录)

柔光的暖阳◎ 2021-12-22 15:51 313阅读 0赞

You’ve been tinkering with threading. Drag+Drop doesn’t like threads. It will only work on threads that are properly initialized with Thread.SetApartmentState() to select STA and that pump a message loop with Application.Run() or Form.ShowDialog().

1、加[STAThread]

2、Thread t = new Thread(new ThreadStart(A));
t.SetApartmentState(ApartmentState.STA);
t.Start( );

并不能加[STAThread]

有时加[STAThread]这个都会出现问题,不知道是不是Application.Run()上没有做好,但用2方法很少出问题。

转载于:https://www.cnblogs.com/Yjianyong/archive/2012/01/10/2317821.html

发表评论

表情:
评论列表 (有 0 条评论,313人围观)

还没有评论,来说两句吧...

相关阅读

    相关 摘录

    1.少攀谈,多沉潜,清醒而独立。 2.万事皆虚,万事皆允。 3.今天的翻得每一页书都是以后赚的每一张钱。 4.没有目标,没有人会期待你。 5.你日渐平庸,甘于平庸,将继

    相关 xmpp 注册Registration

    在客户端上开发xmpp的注册功能,即带内注册。 带内注册指的是未在服务器上开通账号的用户可以通过xmpp协议注册新账号。相反的概念是带外注册(out-of-band r