Hi,

> This code will allow me to run only one version (which I want):
> 
>   s_hMutex := wapi_CreateMutex( NIL, NIL, "HBNetSvr" )
>   IF ! Empty( s_hMutex ) .AND. wapi_GetLastError() == 0
>      alert("=> Hello World! OK.")
>   ELSE
>      alert("=> Application is running. Error")
>      return
>   ENDIF
> 
> This code allows me to run multiple versions, and is functionally no 
> different to my eye:
> 
>   IF ! Empty( wapi_CreateMutex( NIL, NIL, "HBNetSvr" ) ) .AND. 
> wapi_GetLastError() == 0
>      alert("=> Hello World! OK.")
>   ELSE
>      alert("=> Application is running. Error")
>      return
>   ENDIF
> 
> Can someone explain it to me?

In second version you don't assign the returned 
mutex handle to a variable, therefore it's 
instantly released by GC, along with the mutex.

Viktor

_______________________________________________
Harbour mailing list (attachment size limit: 40KB)
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to