Autoit not seeing [out] parameters

Recommended Posts

tlman12 0

tlman12 0

so I'm trying to interface with a programs API and everything seems to work fine with autoit. i can create the object, initialize it, run the functions.

the problem comes when the function has an [out] parameter.

so like there's a function that is .GetLastError($errortext) but $errortext is an output and the function is supposed to write the results to that variable. instead of getting error text i get nothing.

the functions accept inputs just fine, and it works properly in vbscript. i'd like to use autoit though so i can create a gui wrapper for the api calls.

is there something i should be doing to get the info from the variables? or is there a special way to declare the variables? i've never had this problem before.

Share this post

Link to post

Share on other sites

tlman12 0

tlman12 0

the autoit code is practically verbatim of the vbs code so i'm not sure how it's going to help, but imho this script is worthless to anyone trying to help me that doesn't have sophos safeguard encryption unless you know what the problem may be. it doesn't get past line 38 without the software installed. and on my computer everything works but the [out] variables in the functions.

Share this post

Link to post

Share on other sites

water 1,846

water 1,846

... so like there's a function that is .GetLastError($errortext) but $errortext is an output and the function is supposed to write the results to that variable. instead of getting error text i get nothing. ...

$ret is set to the success/fail number value from my list above, so 0 means the function ran properly 1 means it failed. The API reference that i posted a link to has this as the description of that function

Uint32 Base::GetLastError(out string errorText)

Retrieves a textual representation of the last (internal) error occurred.

Note: In contrast to other API methods this method returns an unsigned integer which holds the

Share this post

Link to post

Share on other sites

tlman12 0

tlman12 0

On this page you'll find the link to the download section. Try 3.3.9.4

didn't work with beta either. is there any reason this wouldn't be working? i would think that if it works in vbscript it should work in autoit. and like i said, based on the actual return values, i know the functions are working properly. i'm just not getting the info i need.

...and then after you confirm correct version of AutoIt and object generation you should load with the file whose path will be printed as third line of the console output and then search for the method of the object that doesn't work like you expect it. When found, post the method definition here.

...and then after you confirm correct version of AutoIt and object generation you should load with the file whose path will be printed as third line of the console output and then search for the method of the object that doesn't work like you expect it. When found, post the method definition here.

edit: reworded

Ran that, didn't get a file path so i added the rest of the numbers in that objName() and got that console print.