From 94ea85eac817f66a15ffd0fa3213391aded502bb Mon Sep 17 00:00:00 2001 From: ehouse Date: Fri, 30 Jan 2004 05:45:23 +0000 Subject: [PATCH] move logLastError --- wince/cedraw.c | 38 +------------------------------------- 1 file changed, 1 insertion(+), 37 deletions(-) diff --git a/wince/cedraw.c b/wince/cedraw.c index d73af1f99..3f2923133 100755 --- a/wince/cedraw.c +++ b/wince/cedraw.c @@ -339,42 +339,6 @@ ce_draw_clearRect( DrawCtx* p_dctx, XP_Rect* rectP ) ceClearToBkground( (CEDrawCtx*)p_dctx, rectP ); } /* ce_draw_clearRect */ -#ifdef DEBUG -static void -logLastError() -{ - LPVOID lpMsgBuf; - DWORD lastErr = GetLastError(); - XP_UCHAR msg[256]; - XP_U16 len; - - FormatMessage( - FORMAT_MESSAGE_ALLOCATE_BUFFER | - FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, - lastErr, - 0, // Default language - (LPTSTR) &lpMsgBuf, - 0, - NULL - ); - - len = wcslen( lpMsgBuf ); - if ( len >= sizeof(msg) ) { - len = sizeof(msg) - 1; - } - WideCharToMultiByte( CP_ACP, 0, lpMsgBuf, len + 1, - msg, len + 1, NULL, NULL ); - LocalFree( lpMsgBuf ); - - - XP_LOGF( "system error: %s", msg ); -} /* logLastError */ -#else -# define logLastError() -#endif - static void ceDrawBitmapInRect( HDC hdc, XP_U32 x, XP_U32 y, HBITMAP bitmap ) { @@ -388,7 +352,7 @@ ceDrawBitmapInRect( HDC hdc, XP_U32 x, XP_U32 y, HBITMAP bitmap ) nBytes = GetObject( bitmap, sizeof(bmp), &bmp ); XP_ASSERT( nBytes > 0 ); if ( nBytes == 0 ) { - logLastError(); + logLastError( "ceDrawBitmapInRect:GetObject" ); } BitBlt( hdc, x, y, bmp.bmWidth, bmp.bmHeight,