static void Main() { string errmsg = ""; if (YAPI.RegisterHub("usb", ref errmsg) != YAPI.SUCCESS) { MessageBox.Show(errmsg); return; } YAPI.DisableExceptions(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); }
public Form1() { string errmsg = ""; InitializeComponent(); card_exp.Text = ""; card_extra.Text = ""; // Setup Yoctopuce API YAPI.DisableExceptions(); if (DEBUG) { YAPI.RegisterLogFunction(this.Log); } if (YAPI.RegisterHub("usb", ref errmsg) != YAPI.SUCCESS) { Log("Cannot connect to USB devices:"); Log(errmsg); } YAPI.RegisterDeviceArrivalCallback(this.ArrivalCallback); }