Sign in to follow this  
Followers 0
rodelio

@error = 1: What are the possible solutions?

3 posts in this topic

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

Share this post


Link to post
Share on other sites



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])

Share this post


Link to post
Share on other sites

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?

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