From c6bbd0eacbb2b0219db76905d5dffa94365ea034 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 18 Jun 2008 09:41:03 +0000 Subject: [PATCH] 2008-06-18 11:39 UTC+0200 Viktor Szakats (harbour.01 syenar hu) * source/rtl/gtclip.c ! hb_gt_w32_setClipboard() fix to CF_UNICODETEXT EOS char setting. [TOMERGE RC1] * source/rtl/gtwvt/gtwvt.c + Internal error string cleanup. --- harbour/ChangeLog | 9 +++++++++ harbour/source/rtl/gtclip.c | 8 ++++---- harbour/source/rtl/gtwvt/gtwvt.c | 9 ++++----- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index d770e35d6a..bb88d4e388 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,15 @@ 2008-12-31 13:59 UTC+0100 Foo Bar */ +2008-06-18 11:39 UTC+0200 Viktor Szakats (harbour.01 syenar hu) + * source/rtl/gtclip.c + ! hb_gt_w32_setClipboard() fix to CF_UNICODETEXT + EOS char setting. + [TOMERGE RC1] + + * source/rtl/gtwvt/gtwvt.c + + Internal error string cleanup. + 2008-06-18 10:06 UTC+0200 Viktor Szakats (harbour.01 syenar hu) * source/rtl/gtwvt/gtwvt.c + Now showing the application's executable name diff --git a/harbour/source/rtl/gtclip.c b/harbour/source/rtl/gtclip.c index aead764d2c..1ab8ba7d29 100644 --- a/harbour/source/rtl/gtclip.c +++ b/harbour/source/rtl/gtclip.c @@ -91,12 +91,12 @@ BOOL hb_gt_getClipboard( char ** pszClipData, ULONG *pulLen ) BOOL hb_gt_w32_setClipboard( UINT uFormat, char * szClipData, ULONG ulLen ) { - LPTSTR lptstrCopy; - HGLOBAL hglbCopy; BOOL fResult = FALSE; if( OpenClipboard( NULL ) ) { + HGLOBAL hglbCopy; + EmptyClipboard(); /* Allocate a global memory object for the text. */ @@ -104,13 +104,13 @@ BOOL hb_gt_w32_setClipboard( UINT uFormat, char * szClipData, ULONG ulLen ) if( hglbCopy ) { /* Lock the handle and copy the text to the buffer. */ - lptstrCopy = ( LPTSTR ) GlobalLock( hglbCopy ); + LPTSTR lptstrCopy = ( LPTSTR ) GlobalLock( hglbCopy ); if( lptstrCopy ) { if( uFormat == CF_UNICODETEXT ) { hb_mbtowcset( ( LPWSTR ) lptstrCopy, szClipData, ulLen ); - lptstrCopy[ ulLen * sizeof( wchar_t ) ] = L'\0'; + * ( ( ( LPWSTR ) lptstrCopy ) + ulLen ) = L'\0'; } else { diff --git a/harbour/source/rtl/gtwvt/gtwvt.c b/harbour/source/rtl/gtwvt/gtwvt.c index 1ffc9f778f..bb6a454eef 100644 --- a/harbour/source/rtl/gtwvt/gtwvt.c +++ b/harbour/source/rtl/gtwvt/gtwvt.c @@ -1603,24 +1603,23 @@ static void hb_gt_wvt_Init( PHB_GT pGT, FHANDLE hFilenoStdin, FHANDLE hFilenoStd if( ! hb_winmainArgGet( &s_hInstance, &s_hPrevInstance, &s_iCmdShow ) ) { - hb_errInternal( 10001, "It's not a window GUI program.", NULL, NULL ); + hb_errInternal( 10001, "It's not a Windows GUI program", NULL, NULL ); } pWVT = hb_gt_wvt_New( pGT ); if( !pWVT ) { - hb_errInternal( 10001, "Cannot allocate new window", NULL, NULL ); + hb_errInternal( 10001, "Maximum number of WVT windows reached, cannot create another one", NULL, NULL ); } HB_GTLOCAL( pGT ) = ( void * ) pWVT; pWVT->hWnd = hb_gt_wvt_CreateWindow( ( HINSTANCE ) s_hInstance, ( HINSTANCE ) s_hPrevInstance, - "", s_iCmdShow ); + NULL, s_iCmdShow ); if( !pWVT->hWnd ) { - /* hb_errRT_TERM( EG_CREATE, 10001, "WINAPI CreateWindow() failed", "hb_gt_wvt_Init()", 0, 0 ); */ - hb_errInternal( 10001, "WINAPI CreateWindow() failed", NULL, NULL ); + hb_errInternal( 10001, "WVT window creation failed", NULL, NULL ); } hb_gt_wvt_InitWindow( pWVT, WVT_DEFAULT_ROWS, WVT_DEFAULT_COLS );