Jump to content

PB in GetObj and Autoit.Error


Recommended Posts

Bonjour,

Hello,

Quand j'exécute le code ci-dessous, j'ai, sur certains groupes, une erreur non prise en compte par le gestionnaire d'erreur "ComError" ((5117) : ==> The requested action with this object has failed.) alors que sur d'autres groupes, le gestionnaire "ComError" prend bien en compte l'errreur. Avez-vous une idée pour éviter cela ?

When I carry out the code below, I have, on certain groups, an error not taken into account by the manager of error "ComError" ((5117): ==> The requested action with this object has failed.) whereas on other groups, the manager "ComError" takes into account the errror well. Do you have an idea to avoid that?

Merci par avance

Thank you by advance

(PS : Qui connait la date de sortie de la prochaine en version finale d'autoit ?)

(PS: Who know the date of release of next in final version of autoit?)

Eric

Msgbox(0, "test", Proprietaire("CN=TestListe,OU=Listes Diffusions,OU=Toto,OU=Messagerie,OU=Migration,DC=Srv,DC=Test,DC=fr)

Exit

Func Proprietaire($Groupe)

Local $objItem, $objItem1, $ManagedBy = "", $Managed = ""

$oMyError = ObjEvent("AutoIt.Error", "ComError")

$objItem = ObjGet("LDAP://" & $Groupe)

If (Not @error) And (IsObj($objItem)) Then

$oMyError = ObjEvent("AutoIt.Error", "ComError")

$Managed = $objItem.Get ("managedBy")

If Not @error Then

If $Managed <> "" Then

$objItem1 = ObjGet("LDAP://" & $Managed)

$ManagedBy = $objItem1.Get ("Name")

EndIf

EndIf

EndIf

Return $ManagedBy

EndFunc ;==>Proprietaire

Func ComError()

Local $HexNumber

If IsObj($oMyError) Then

$HexNumber = Hex($oMyError.number, 8)

If Not @Compiled Then

MsgBox(0, "AutoItCOM", "Une erreur COM a été intercepté !" & @CRLF & @CRLF & _

"err.description is: " & @TAB & $oMyError.description & @CRLF & _

"err.numéro is: " & @TAB & $HexNumber & @CRLF & _

"err.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF)

EndIf

SetError($HexNumber)

EndIf

Return 0

EndFunc ;==>ComError

Link to comment
Share on other sites

Bonjour,

Hello,

Quand j'exécute le code ci-dessous, j'ai, sur certains groupes, une erreur non prise en compte par le gestionnaire d'erreur "ComError" ((5117) : ==> The requested action with this object has failed.) alors que sur d'autres groupes, le gestionnaire "ComError" prend bien en compte l'errreur. Avez-vous une idée pour éviter cela ?

When I carry out the code below, I have, on certain groups, an error not taken into account by the manager of error "ComError" ((5117): ==> The requested action with this object has failed.) whereas on other groups, the manager "ComError" takes into account the errror well. Do you have an idea to avoid that?

Merci par avance

Thank you by advance

(PS : Qui connait la date de sortie de la prochaine en version finale d'autoit ?)

(PS: Who know the date of release of next in final version of autoit?)

Eric

Msgbox(0, "test", Proprietaire("CN=TestListe,OU=Listes Diffusions,OU=Toto,OU=Messagerie,OU=Migration,DC=Srv,DC=Test,DC=fr)

Exit

Func Proprietaire($Groupe)

Local $objItem, $objItem1, $ManagedBy = "", $Managed = ""

$oMyError = ObjEvent("AutoIt.Error", "ComError")

$objItem = ObjGet("LDAP://" & $Groupe)

If (Not @error) And (IsObj($objItem)) Then

$oMyError = ObjEvent("AutoIt.Error", "ComError")

$Managed = $objItem.Get ("managedBy")

If Not @error Then

If $Managed <> "" Then

$objItem1 = ObjGet("LDAP://" & $Managed)

$ManagedBy = $objItem1.Get ("Name")

EndIf

EndIf

EndIf

Return $ManagedBy

EndFunc ;==>Proprietaire

Func ComError()

Local $HexNumber

If IsObj($oMyError) Then

$HexNumber = Hex($oMyError.number, 8)

If Not @Compiled Then

MsgBox(0, "AutoItCOM", "Une erreur COM a été intercepté !" & @CRLF & @CRLF & _

"err.description is: " & @TAB & $oMyError.description & @CRLF & _

"err.numéro is: " & @TAB & $HexNumber & @CRLF & _

"err.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF)

EndIf

SetError($HexNumber)

EndIf

Return 0

EndFunc ;==>ComError

Oups, erreur dans le N° d'erreur. Le N° est 80020009 et pas 5117 :o

Oups, Error in the N° of error. The error is 80020009 and not 5117

Certaines fois, la routine ComError n'est pas appellée et le programme s'arrete avec une erreur qui devrait être traitée par ComError

Certain times, the ComError routine are not call and the program stop with an error which should be treated by ComError

Une idée ?

A idea ?

Merci d'avance

Thanks you by advance

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...