执行CreateHandle()时无法调用值Dispose(),是怎么回事???
如题!代码如下:
namespace Adt850
{
public partial class frmMain
{
Thread MyThread;
int val,val1,speed;
public frmMain()
{
initializeComponent();
CheckforIllegalCrossThreadCalls=false;
MyThread=new Thread(new ThreadStart(ThreadSet));
MyThread.Start();
}
private void ThreadSet()
{
while(true)
{
adt850_a.get_command_pos(0,1,out val);//调用dll函数
txtGetLocationX.Text=Convert.ToString((float)5*val/300);
adt850_a.get_command_pos(0,2,out val1);
txtGetLocationY.Text=Convert.ToString((float)5*val1/300);
adt850_a.get_speed(0,1,out speed);
txtGetSpeed.Text=Convert.ToString(speed);
}
}
}
}
在退出程序时,会发生objectDisposeException异常
和执行CreateHandle()时无法调用值Dispose()的错误
是什么原因???