oktoberfest2 0 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 Share this post Link to post Share on other sites
SmOke_N 211 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. Share this post Link to post Share on other sites
big_daddy 20 Posted September 27, 2007 Using a variable ByRef through COM is still not supported. I've posted a request here. Share this post Link to post Share on other sites
oktoberfest2 0 Posted September 27, 2007 Thanks for the responses. I'm sure the functionality will come shortly. Share this post Link to post Share on other sites
AcidCorps 1 Posted October 17, 2008 is there a solution for this, I'm having the same problem with my current script Share this post Link to post Share on other sites
amokoura 1 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... Share this post Link to post Share on other sites