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
This commit is contained in:
Viktor Szakats
2011-07-04 18:42:39 +00:00
parent 20ffa7b415
commit 8f604a2fb7
2 changed files with 22 additions and 3 deletions

View File

@@ -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.

View File

@@ -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