1

My project has several hardware components that have to work together.

I have as part of my project a BlackMagic Decklink video card which I have successfully accessed via the BlakcMagic SDK.

I developed a user control in a separate project and now I want to integrate that code with my main project.

The only problem I have is that the BlackMagic interface requires MTA model, the main project is an STA model and due to the other hardware interface, has to stay that way.

My question is, how can I substantiate an instance of an MTA user control in an STA environment?

4

1 回答 1

-1

这里的诀窍是添加语句:

[MTAThread]

在父类的Load方法前面。在这种情况下,我将usercontrol封装在另一个表单中,并在form_load(){}前面添加了语句。

生成的 UserControl 然后存在于 MTA 模型中。

于 2015-01-28T17:29:13.530 回答