I have two projects within my solution and in each there is one form.
I am trying to open the second form within an if statement but what happens is, when the new form is declared, the code suddenly breaks at that point and moves onto the client.close();
without completing the declaration.
I usually program in asp.net and I haven't seen something like this before, the code never runs through to .ShowDialog()
and doesn't break with error.
else if (DeviceRead == "DeviceRead:2")
{
_RequestID = RequestID.Remove(0, 10);
_DeviceID = DeviceRead.Remove(0, 11);
//this.Hide();
GenericEPadDemo.frmMain sig = new GenericEPadDemo.frmMain();
sig.ShowDialog();
}
}
s.Close();
}
finally
{
client.Close();
}
The error being returned is: ActiveX control '30778fc6-eaba-43a7-ba39-6875a3b16057'
cannot be instantiated because the current thread is not in a single-threaded apartment.