void CLCDOutput::Close(void) { if( LGLCD_INVALID_DEVICE != m_hDevice ) { OnClosingDevice(m_hDevice); lgLcdClose(m_hDevice); m_hDevice = LGLCD_INVALID_DEVICE; } }
//************************************************************************ // // CLCDOutput::HandleErrorFromAPI // //************************************************************************ void CLCDOutput::HandleErrorFromAPI(DWORD dwRes) { switch(dwRes) { // all is well case ERROR_SUCCESS: break; // we lost our device case ERROR_DEVICE_NOT_CONNECTED: LCDUITRACE(_T("lgLcdAPI returned with ERROR_DEVICE_NOT_CONNECTED, closing device\n")); OnClosingDevice(m_hDevice); break; default: LCDUITRACE(_T("lgLcdAPI returned with other error (0x%08x) closing device and connection\n")); OnClosingDevice(m_hDevice); OnDisconnecting(m_hConnection); // something else happened, such as LCDMon that was terminated break; } }
void CLCDOutput::CloseAndDisconnect() { OnClosingDevice(m_hDevice); OnDisconnecting(m_hConnection); }