Jump to content

Dll problems


Recommended Posts

Ok so I decided to make my own DLL for some audio stuff I want to do and tried to test out compatibality in auto-it.

This is what the Dll code looks like (in VB) which compiles fine.

Public Class Addnumbers
    Public Number1 As Object
    Public Number2 As Object
    Function Add(ByVal Number1, ByVal Number2)
        Add = Number1 + Number2
    End Function
End Class

Public Class Subnumbers
    Public Number1 As Object
    Public Number2 As Object
    Function Subtract(ByVal Number1, ByVal Number2)
        Subtract = Number1 - Number2
    End Function
End Class

And here is my auto-it code

Func Add()
    $x = 1
    $y = 2
    $result = DllCall("eg104.dll", "int", "Addnumbers", "int", $x, "int", $y)
    if @error = 1 Then
        MsgBox(0x0,"Result","Bad Dll")
    ElseIf @error = 3 Then
        MsgBox(0x0,"Result","Function not found")
    Else
        MsgBox(0x0,"Result",$x &" + "& $y & " = "& $result)
    EndIf
EndFunc

In the Dll call I have tried Addnumbers, Add, and Addnumbers.Add which returns "Function not found" each time. My guess is something with the classes but it's been a while since I have done VB and Java and C++ have melded into one language which is now corrupting other languages. I know I have to be missing something simple but it's been a while since I have blinked and need a fresh pair of eyes.

~Shadesdude

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...