Unable to cast COM object of type exception

前端 未结 4 1835
感情败类
感情败类 2020-12-09 09:34

I have the following code:

public void Test(IMyInterface iInterface)
{
  iInterface.CallMethod ( );
}

Which works fine. However, if I chang

4条回答
  •  猫巷女王i
    2020-12-09 10:15

    I got an advice and it helped me!

    Find in the main thread (Program.cs) the line [STAThread] and change it to [MTAThread].

提交回复
热议问题