private void ReadBarcode() { byte[] ReceiveBuf; byte[] CountBuf; ReceiveBuf = new byte[128]; CountBuf = new byte[1]; while (true) { if (0 /*WAIT_OBJECT_0*/ == EM1300DLL.WaitForSingleObject(exitThreadEvent, 0)) { break; } Ret_Value uiState = EM1300DLL.EM1300GetDecodeData(ReceiveBuf, CountBuf); if (uiState == Ret_Value.RECEIVE_SUCCESS) { strDisp = ""; //Buzzer.BeepOK(); int count = CountBuf[0]; for (int i = 0; i < count; i++) { strDisp += (char)ReceiveBuf[i]; } somedle sd = new somedle(ShowBarcode); this.Invoke(sd); } Thread.Sleep(2); } }
private void ReadBarcode() { byte[] ReceiveBuf; byte[] CountBuf; ReceiveBuf = new byte[128]; CountBuf = new byte[1]; while (true) { if (paused) { resumeEvent.WaitOne(); paused = false; } Ret_Value uiState = EM1300DLL.EM1300GetDecodeData(ReceiveBuf, CountBuf); if (uiState == Ret_Value.RECEIVE_SUCCESS /*RECEIVE_SUCCESS*/) { strDisp = ""; Buzzer.BeepOK(); int count = CountBuf[0]; for (int i = 0; i < count; i++) { strDisp += (char)ReceiveBuf[i]; } Pause(); } Thread.Sleep(2); } }