Exemplo n.º 1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            WacomMTError status = WacomMTError.WMTErrorSuccess;

            IntPtr userDataBuf = IntPtr.Zero;

            try
            {
                mWacomMTConfig.Init();

                //Delegate called when events come to tablet
                mUpdateRealTimeLabel  = new UpdateDelegate(this.DoUpdateGraphicsControl);
                mUpdateRealTimeLabel += this.DoSendMidiMessage;

                // crée un nouveau callback attach et abonne a ce callback
                mAttachCallback = new WacomMTAttachCallback(this.DoAttachWindowClientCallback);
                status          = CWacomMTInterface.WacomMTRegisterAttachCallback(this.mAttachCallback, IntPtr.Zero);

                if (status != WacomMTError.WMTErrorSuccess)
                {
                    throw new Exception("Failed to register for device attaches - err: " + status.ToString());
                }

                // crée un nouveau callback detack et abonne a ce callback
                mDetachCallback = new WacomMTDetachCallback(this.DoDetachWindowClientCallback);
                status          = CWacomMTInterface.WacomMTRegisterDetachCallback(this.mDetachCallback, IntPtr.Zero);

                if (status != WacomMTError.WMTErrorSuccess)
                {
                    throw new Exception("Failed to register for device detaches - err: " + status.ToString());
                }

                //crée un nouveau callback de type Finger Read et abonne a celui-ci
                WacomMTHitRect HR = new WacomMTHitRect(0, 0, 0, 0);
                mTouchDataCallback = new WacomMTCallback(this.DoFingerDataUpdateCallback);
                status             = CWacomMTInterface.WacomMTRegisterFingerReadCallback(0, ref HR, _processingMode,
                                                                                         mTouchDataCallback, IntPtr.Zero);

                UpdateLabelText();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error : " + ex.ToString());
            }
        }
Exemplo n.º 2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            WacomMTError status = WacomMTError.WMTErrorSuccess;

            IntPtr userDataBuf = IntPtr.Zero;
            try
            {
                mWacomMTConfig.Init();

                //Delegate called when events come to tablet
                mUpdateRealTimeLabel = new UpdateDelegate(this.DoUpdateGraphicsControl);
                mUpdateRealTimeLabel += this.DoSendMidiMessage;

                // crée un nouveau callback attach et abonne a ce callback
                mAttachCallback = new WacomMTAttachCallback(this.DoAttachWindowClientCallback);
                status = CWacomMTInterface.WacomMTRegisterAttachCallback(this.mAttachCallback, IntPtr.Zero);

                if (status != WacomMTError.WMTErrorSuccess)
                {
                    throw new Exception("Failed to register for device attaches - err: " + status.ToString());
                }

                // crée un nouveau callback detack et abonne a ce callback
                mDetachCallback = new WacomMTDetachCallback(this.DoDetachWindowClientCallback);
                status = CWacomMTInterface.WacomMTRegisterDetachCallback(this.mDetachCallback, IntPtr.Zero);

                if (status != WacomMTError.WMTErrorSuccess)
                {
                    throw new Exception("Failed to register for device detaches - err: " + status.ToString());
                }

                //crée un nouveau callback de type Finger Read et abonne a celui-ci
                WacomMTHitRect HR = new WacomMTHitRect(0, 0, 0, 0);
                mTouchDataCallback = new WacomMTCallback(this.DoFingerDataUpdateCallback);
                status = CWacomMTInterface.WacomMTRegisterFingerReadCallback(0, ref HR, _processingMode,
                    mTouchDataCallback, IntPtr.Zero);

                UpdateLabelText();

            }
            catch (Exception ex)
            {
                MessageBox.Show("Error : " + ex.ToString());
            }

        }