From ef2d74889fcface9bb0dae4ede72e0c68f290154 Mon Sep 17 00:00:00 2001 From: Przemyslaw Czerpak Date: Fri, 22 Oct 2010 09:24:34 +0000 Subject: [PATCH] 2010-10-22 11:24 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/src/rtl/gtwvt/gtwvt.c ! use ERROR_CLASS_ALREADY_EXISTS instead of hardcoded 1410 value * allow to use GTWVT in programs linked as non GUI ones (console programs) --- harbour/ChangeLog | 6 ++++++ harbour/src/rtl/gtwvt/gtwvt.c | 7 +++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 924906ef2c..933fb79069 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,12 @@ The license applies to all entries newer than 2009-04-28. */ +2010-10-22 11:24 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/src/rtl/gtwvt/gtwvt.c + ! use ERROR_CLASS_ALREADY_EXISTS instead of hardcoded 1410 value + * allow to use GTWVT in programs linked as non GUI ones + (console programs) + 2010-10-22 01:39 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) * contrib/hbqt/qtcore/g/HBQString.cpp * contrib/hbqt/qtcore/g/QAbstractItemModel.cpp diff --git a/harbour/src/rtl/gtwvt/gtwvt.c b/harbour/src/rtl/gtwvt/gtwvt.c index 8cb91c4f2c..8a09431c6c 100644 --- a/harbour/src/rtl/gtwvt/gtwvt.c +++ b/harbour/src/rtl/gtwvt/gtwvt.c @@ -148,7 +148,7 @@ static void hb_gt_wvt_RegisterClass( HINSTANCE hInstance ) if( ! RegisterClass( &wndclass ) ) { - if( GetLastError() != 1410 ) + if( GetLastError() != ERROR_CLASS_ALREADY_EXISTS ) hb_errInternal( 10001, "Failed to register WVT window class", NULL, NULL ); } } @@ -1882,7 +1882,10 @@ static void hb_gt_wvt_Init( PHB_GT pGT, HB_FHANDLE hFilenoStdin, HB_FHANDLE hFil HB_TRACE( HB_TR_DEBUG, ( "hb_gt_wvt_Init(%p,%p,%p,%p)", pGT, ( void * ) ( HB_PTRDIFF ) hFilenoStdin, ( void * ) ( HB_PTRDIFF ) hFilenoStdout, ( void * ) ( HB_PTRDIFF ) hFilenoStderr ) ); if( ! hb_winmainArgGet( &hInstance, NULL, &iCmdShow ) ) - hb_errInternal( 10001, "It's not a GUI program", NULL, NULL ); + { + hInstance = GetModuleHandle( NULL ); + iCmdShow = 1; + } pWVT = hb_gt_wvt_New( pGT, ( HINSTANCE ) hInstance, iCmdShow ); if( !pWVT )