E1M1 Posted July 18, 2009 Share Posted July 18, 2009 How do I read return value of dll? MsgBox(1,1,DllCall("dlltutorial1.dll","int","add","int",1,"int",1)) This function should return 2 (1+1), but I see 0 because DllCall() was success, but how can I see return value of dll function? edited Link to comment Share on other sites More sharing options...
Developers Jos Posted July 18, 2009 Developers Share Posted July 18, 2009 How do I read return value of dll? MsgBox(1,1,DllCall("dlltutorial1.dll","int","add","int",1,"int",1)) This function should return 2 (1+1), but I see 0 because DllCall() was success, but how can I see return value of dll function? DllCall() returns an array. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
E1M1 Posted July 18, 2009 Author Share Posted July 18, 2009 Something is wrong here :S $return = DllCall("dlltutorial1.dll","int","add","int",1,"int",1) MsgBox(1,1,$return[0]) Z:\My Documents\11-2008\dllfail\tut1test\dlltutoria.au3 (2) : ==> Subscript used with non-Array variable.: MsgBox(1,1,$return[0]) MsgBox(1,1,$return^ ERROR Does this mean that there is error in dll or there is error in autoit code? edited Link to comment Share on other sites More sharing options...
Developers Jos Posted July 18, 2009 Developers Share Posted July 18, 2009 Something is wrong here :S $return = DllCall("dlltutorial1.dll","int","add","int",1,"int",1) MsgBox(1,1,$return[0]) Z:\My Documents\11-2008\dllfail\tut1test\dlltutoria.au3 (2) : ==> Subscript used with non-Array variable.: MsgBox(1,1,$return[0]) MsgBox(1,1,$return^ ERROR Does this mean that there is error in dll or there is error in autoit code? There is only an Array returned when DllCall() was error free. Read the Helpfile for the details. Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. 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