mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-01 06:19:57 +01:00
move logLastError
This commit is contained in:
parent
5528dc305f
commit
94ea85eac8
1 changed files with 1 additions and 37 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue