在ocx中调用方法时超时 [英] Timeout while calling method inside ocx
问题描述
Dears,
i正在使用Excella Magteck机器的ocx文件。我必须在ocx文件中调用一个方法OpenDevice,它将机器全名作为参数并且返回int作为返回类型如果返回0这意味着机器已成功连接并且机器名称存在但机器名称不存在而不是返回另一个数字应用程序没有响应我等待它约3分钟没有响应所以问题是:
如何设置超时来调用ocx文件中的OpenDevice方法
Dears,
i am working on ocx file for Excella Magteck machine.I have to call a method OpenDevice inside the ocx file that takes machine full name as parameter and returns int as return type if return 0 this means that machine is connected successfully and the machine name exists but while the machine name doesn''t exists instead of return another number the application not responding i wait for it about 3 minute with no response so the question is:
how can i set timeout for calling the OpenDevice method that is inside the ocx file
returnValue = excella.OpenDevice(strCurrentDeviceName);
谢谢...
thanks...
推荐答案
如果我理解正确,你只想超时调用OCX中的方法? ...使用System.Timers.Timer
ATG
If I understand you correctly, you simply want to timeout your call to the method in the OCX? ... use System.Timers.Timer
ATG
这篇关于在ocx中调用方法时超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!