Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed last year.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(1)
实际上发现这与单线程公寓和 COM 对象有关。在创建 JACOB 调用之前,重要的是执行 ComThread.initSTA(),然后在完成后执行 ComThread.Release() 和 ComThread.quitMainSTA()。这应该允许使用 COM 对象进行适当的多线程处理。
Actually found out it was something to do with Single-Thread Apartments and COM objects. before creating the JACOB call it is important to do an ComThread.initSTA() and then when finished do a ComThread.Release() and ComThread.quitMainSTA(). This should allow for proper multi-threading with COM objects.