注意属性[STAThread],它把COM线程模型设置为单线程单元(Single-Threaded Apartment, STA)。COM交互操作需要STA线程模型,默认为添加到Windows窗体项目中。
基于2个网页-相关网页
The COM threading model can be set to single-threaded apartment or multithreaded apartment.
COM 线程模型可设置为单线程单元或多线程单元。
The most probable cause is that a single-threaded apartment (STA) thread is not pumping messages.
原因很可能是单线程单元 (STA) 线程不发送消息。
Currently all the COM objects are only written to support the single threaded apartment model.
目前所有的COM对象只能写成支持单线程的公寓模型。
应用推荐