Jump to content

Recommended Posts

Posted

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

  • Developers
Posted

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.
  :)

Posted

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

  • Developers
Posted

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.
  :)

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
×
×
  • Create New...