oktoberfest2 Posted September 26, 2007 Share Posted September 26, 2007 Problem Description: The $retVal variable below is not returning any value. It should return an encrypted value of the $passwordToEnrypt. The same code in VB works. I have tried the following with no luck as well... $retValue = $test1.EncryptPassword ($passwordToEncrypt, $retVal) I'm hoping that someone has called a function and needed a return value similar to what I'm trying to do. I don't get any error message. The messagebox is simply blank. I appreciate any help that you can offer. $oMyError = ObjEvent("AutoIt.Error","MyErrFunc") dim $retVal dim $passwordToEncrypt= "test" $test = ObjCreate("Session") $test1 = $test.CreateInstance("Instance.UserName") $test1.EncryptPassword ($passwordToEncrypt, $retVal) Msgbox(0,"Encrypted Password", $retVal) Func MyErrFunc() $HexNumber=hex($oMyError.number,8) Msgbox(0,"AutoItCOM Test","We intercepted a COM Error !" & @CRLF & @CRLF & _ "err.description is: " & @TAB & $oMyError.description & @CRLF & _ "err.windescription:" & @TAB & $oMyError.windescription & @CRLF & _ "err.number is: " & @TAB & $HexNumber & @CRLF & _ "err.lastdllerror is: " & @TAB & $oMyError.lastdllerror & @CRLF & _ "err.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF & _ "err.source is: " & @TAB & $oMyError.source & @CRLF & _ "err.helpfile is: " & @TAB & $oMyError.helpfile & @CRLF & _ "err.helpcontext is: " & @TAB & $oMyError.helpcontext _ ) SetError(1) ; to check for after this function returns Exit Endfunc Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted September 26, 2007 Moderators Share Posted September 26, 2007 Do you have the actual function from VB, because this does return an error for me (ObjCreate). Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted September 27, 2007 Moderators Share Posted September 27, 2007 Using a variable ByRef through COM is still not supported. I've posted a request here. Link to comment Share on other sites More sharing options...
oktoberfest2 Posted September 27, 2007 Author Share Posted September 27, 2007 Thanks for the responses. I'm sure the functionality will come shortly. Link to comment Share on other sites More sharing options...
AcidCorps Posted October 17, 2008 Share Posted October 17, 2008 is there a solution for this, I'm having the same problem with my current script Link to comment Share on other sites More sharing options...
amokoura Posted October 17, 2008 Share Posted October 17, 2008 I'm just guessing, but could you use VB scripting objects inside AutoIt? If VBScript supported ByRef, then you could create some kind of a hack... Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now