' something like
'if CheckLogin(login,password) then
' replace by
Dim rs As ResumableSub = LeggiConfig(login, password)
wait For (rs) Complete (Result As object)
If Result = 1 Then
' do whatever you need to do if the login is ok
Else
' do whever you want to do if the login is not ok
End If