[Gambas-user] Error during registration on the D-Bus

Benoît Minisini g4mba5 at gmail.com
Sat Mar 10 18:38:34 CET 2018


Le 10/03/2018 à 18:32, Hans Lehmann a écrit :
> Hello,
> 
> I try in vain to call my service program for the D-Bus only once.
> At the first start I see the window and can use the service with a D-Bus 
> client program.
> After a further start I expect the inserted error message - instead 
> there is an error message:
> 
> This application has raised an unexpected error and must abort.
> Unique application is already registered.
> DBus._RegisterApplication.78
> 
> With kind regards
> 
> Hans
> 
> FMain.class:
> 
> Public Sub Form_Open()
> 
>    DBus.Unique = True
> 
>    If DBus.IsRegistered(Service) Then
>       Message.Error("An instance of " & Application.Name & " already 
> exists.")
>       FMain.Close()
>    Else
>       DBus.Session.Register(Service, "/Service")
>    Endif
> 
> End
> 
> Public Sub Form_Close()
> 
>    If DBus.IsRegistered(Service) Then DBus.Session.Unregister(Service)
>    FMain.Close()
> 
> End
> 
> -------------------------------------------------------------------------------------------------- 
> 
> 
> Service.class:
> 
> Inherits DBusObject
> Create Static
> 
> Public Function ComputeAdd(Value1 As Float, Value2 As Float) As Float
>    Return Value1 + Value2
> End
> 

1) Please post full projects, otherwise it's a pain for me to debug.

2) Please create a new thread when you create a new subject. Don't reply 
to another post!

Thanks.

-- 
Benoît Minisini


More information about the User mailing list