Sign in to follow this  
Followers 0
kizsdet

Dll Call Problem

7 posts in this topic

hi guys..can you help me with this one..i have a dll written in vb6..

Public Function addMe(x As Integer, y As Integer) As Integer

addMe = x + y

End Function

how can i call it from autoit?

here's what i have tried so far..

dim $test
$test = DllCall("Project1.dll","int","addme","int",1,"int",2)
msgbox("","try",$test)

thanks in advance..

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Dont know anything about vb but

dim $test 
$test = DllCall("Project1.dll","int","addme","int",1,"int",2) 
If @error then 
exit 
endif  
msgbox("","try",$test[0]) ; dllcall returns an array
Edited by JohnOne

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

thanks for the reply sir but still doesn't work..

here's the error found after removing the error handler..

Subscript used with non-Array variable.:
msgbox("","try",$test[0])
msgbox("","try",$test^ ERROR

Share this post


Link to post
Share on other sites

You shouldnt get an error really, it should exit.

dim $test 
$test = DllCall("Project1.dll","int","addme","int",1,"int",2) 
If @error then 
msgbox("","try",@error); look in the helpfile for @error codes for dllcall
exit 
endif  
msgbox("","try",$test[0]) ; dllcall returns an array

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

yes, its just exiting and not doing the dll function that why i remove the error handler to find whats the error.

anyone who got solution for this?

Share this post


Link to post
Share on other sites

yes, its just exiting and not doing the dll function that why i remove the error handler to find whats the error.

anyone who got solution for this?

Get out of the freaking box you're in.

Run the code JohnOne gave you.


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0