HACL终端仿真器自动化:ECLPS对象和线程

编程入门 行业动态 更新时间:2024-10-26 06:26:40
本文介绍了HACL终端仿真器自动化:ECLPS对象和线程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在使用IBM HACL进行终端仿真器自动化。在执行线程中,我可以访问HACL编程对象及其属性/方法。我的意图不是阻止主线程,而是通过后台工作人员完成工作。在这里我所有的尝试都失败了。 我尝试过: 这有效:

I'm working on terminal emulator automation using IBM HACL. In the execution thread I can access the HACL programming objects and their properties/methods. My intention is not to block the main thread, but have the job done via background worker. Here all my attempts failed. What I have tried: This works:

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load Dim pConnList As AutConnListTypeLibrary.AutConnList pConnList = New AutConnListTypeLibrary.AutConnList pConnList.Refresh() Debug.Print("Number of sessions: " & pConnList.Count) 'Result: 'Number of sessions: 2 End Sub

但后台工作人员无法做到这一点。在创建对象实例时会抛出异常:

But the same is not possible from the background worker. When creating the instance of the object the exception is thrown:

Private Sub bw_DoWork(sender As Object, e As DoWorkEventArgs) Handles bw.DoWork Dim pConnList As AutConnListTypeLibrary.AutConnList Try pConnList = New AutConnListTypeLibrary.AutConnList pConnList.Refresh() Debug.Print("Number of sessions: " & pConnList.Count) Catch ex As Exception Debug.Print(ex.Message.ToString) 'Result: 'Exception thrown: 'System.InvalidCastException' in Pcomm test.exe 'Unable to cast COM object of type 'System.__ComObject' to interface type 'AutConnListTypeLibrary.AutConnList'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{3CB39CC1-6F18-11D0-910D-0004AC3617E1}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)). End Try End Sub

推荐答案

使用后期绑定 pConnList = CreateObject(PCOMM.AutConnList) 应该有帮助 如果您想使用intelisense您可以尝试使用 NuGet画廊| PCOMMLib 1.0.1 [ ^ ] 可在此处获得: Vrzasq / PCOMMLib - Bitbucket [ ^ ]

更多推荐

HACL终端仿真器自动化:ECLPS对象和线程

本文发布于:2023-11-04 05:16:18,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1557042.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:仿真器   终端   线程   对象   HACL

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!