날자별

2021 3월
1234567
891011121314
15161718192021
22232425262728
293031  

CxImage에서 try catch를 사용하는 방법

[cpp]cx_try { ximage->Decode( _m_pbyRead + jpgInfo.unPointerStart, jpgInfo.unSize, CXIMAGE_FORMAT_JP2 ); } cx_catch { if ( strcmp(message,””) ) { TCHAR szMessage[255]; CAnyString::MBCS2Unicode( message, szMessage ); theLog( CAnyLog::LOG_ERROR, szMessage ); } } [/cpp]

이쁘게 작성한 try-catch문

[java]public void doGet( …. ) { try { conn = getConnection(); stmt = conn.createStatement(); stmt.executeQuery(sql); …… } catch (Exception e) { …… } finally { try{ rs .close();} catch (Exception e){ } try{ stmt.close();} catch (Exception e){ } try{ conn.close();} catch (Exception e){ } } }[/java]