rodelio Posted March 19, 2009 Posted March 19, 2009 I am very new to AutoIt. I made a Win32 dll in VB6.0 and I am trying to call it with AutoIt but it is returning an Error of 1 which means "unable to use the DLL file". I am not sure if its because the dll was made in VB6.0 or that I am such a newbie that I don't know how to properly call the dll. The parameter for the function in the dll are two strings and two longs and the return value is also a string. The parameters are all passed by reference. This is the function signature in the VB6.0 Win32 dll. Public Function PokerGetPercentage(pocket As String, board As String, opponents As Long, accuracy As Long) As String This is how I am calling it. $result = DllCall("E:\PokerCaller\PokerWin32\PokerWin32.dll", "wstr", "PokerGetPercentage", "wstr*", "6h 6d", "wstr*", "6s 8d Qh Ad", "Int32", 4, "Int32", 12) msgbox(0,"error",@error) msgbox(0,"",$result) What am I doing wrong? TIA
Zedna Posted March 19, 2009 Posted March 19, 2009 Try this: $result = DllCall("E:\PokerCaller\PokerWin32\PokerWin32.dll", "str", "PokerGetPercentage", "str", "6h 6d", "str", "6s 8d Qh Ad", "Int", 4, "Int", 12) msgbox(0,"error",@error) msgbox(0,"",$result[0]) Resources UDF ResourcesEx UDF AutoIt Forum Search
rodelio Posted March 20, 2009 Author Posted March 20, 2009 Thanks Zedna, much appreciated. I think the bigger problem is there are restrictions on what I can use in the functions in the Win32 dll made in VB6.0. I cannot even instantiate a class from there or call the intrinsic VB6.0 functions. =( I can call a simple function like this: Public Function TestFunction(ByVal result As Long) As String Dim s As String s = "rodelio" TestFunction = s End Function But not if I instantiate a class from that function: Public Function TestFunction(ByVal result As Long) As String Dim s As String [b]Dim Poker As PokerHand Set Poker = New PokerHand[/b] s = "rodelio" TestFunction = s End Function Is there a workaround with that?
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