예제 #1
0
        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());
        }
예제 #2
0
        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);
        }