When I call the open method of my Manager object, the attach handler is fired for all connected devices, but when I read the Devices property of my Manager object in this attach event handler, the program stops responding.
When I debug the event handler and put a breakpoint on the call to the Devices property and try to see the status of the Manager object, I get the error shown in the attached screenshot after about 10 seconds waiting. The source code of my test project is shown below.
I know you have to wait for the interfacekit class before you can use it, but I can't see what I have to wait for with the Manager class. If I wait a little after calling Manager.open(), I can debug the Manager object and use the Devices property properly. Does anybody know what I'm doing wrong or is this a bug of the Phidgets Library?
Thanks for your help
Code: Select all
public partial class Form1 : Form
Manager phidgetManager = null;
private void Form1_Load(object sender, EventArgs e)
void phidgetManager_Attach(object sender, Phidgets.Events.AttachEventArgs e)
// I can get info from the attaced device
// I cannot get info from the Devices property of the phidgetManager
listBox1.Items.Add("Number of attached devices: " + phidgetManager.Devices.Count.ToString());
private void button1_Click(object sender, EventArgs e)
phidgetManager = new Manager();
phidgetManager.Attach += new AttachEventHandler(phidgetManager_Attach);