diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 2f44c7681f..f019df730a 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,11 @@ The license applies to all entries newer than 2009-04-28. */ +2011-07-04 20:41 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * contrib/hbwin/tests/testsvc.prg + + added comment about 'S' internal parameter + + added textual error messages + 2011-07-01 20:03 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * examples/gtwvw/gtwvw.c ! fixed display problem when using browse in wvwtest9 sample. diff --git a/harbour/contrib/hbwin/tests/testsvc.prg b/harbour/contrib/hbwin/tests/testsvc.prg index 2983f9224c..a05639373c 100644 --- a/harbour/contrib/hbwin/tests/testsvc.prg +++ b/harbour/contrib/hbwin/tests/testsvc.prg @@ -57,6 +57,8 @@ #define _SERVICE_NAME "Harbour_Test_Service" PROCEDURE Main( cMode ) + LOCAL nError + LOCAL cMsg DEFAULT cMode TO "S" /* NOTE: Must be the default action */ @@ -66,7 +68,10 @@ PROCEDURE Main( cMode ) IF win_serviceInstall( _SERVICE_NAME, "Harbour Windows Test Service" ) ? "Service has been successfully installed" ELSE - ? "Error installing service: " + hb_ntos( wapi_GetLastError() ) + nError := wapi_GetLastError() + cMsg := Space( 128 ) + wapi_FormatMessage( ,,,, @cMsg ) + ? "Error installing service: " + hb_ntos( nError ) + " " + cMsg ENDIf EXIT @@ -75,16 +80,25 @@ PROCEDURE Main( cMode ) IF win_serviceDelete( _SERVICE_NAME ) ? "Service has been deleted" ELSE - ? "Error deleting service: " + hb_ntos( wapi_GetLastError() ) + nError := wapi_GetLastError() + cMsg := Space( 128 ) + wapi_FormatMessage( ,,,, @cMsg ) + ? "Error deleting service: " + hb_ntos( nError ) + " " + cMsg ENDIf EXIT CASE "S" + /* NOTE: Used when starting up as service. + Do not invoke the executable manually with this option */ + IF win_serviceStart( _SERVICE_NAME, @SrvMain() ) ? "Service has started OK" ELSE - ? "Service has had some problems: " + hb_ntos( wapi_GetLastError() ) + nError := wapi_GetLastError() + cMsg := Space( 128 ) + wapi_FormatMessage( ,,,, @cMsg ) + ? "Service has had some problems: " + hb_ntos( nError ) + " " + cMsg ENDIF EXIT