Declare Function returntwo Lib "C:\Users\owner\Documents\Visual Studio 2013\Projects\ConsoleDLLTest\Debug\ConsoleDLLTest.dll" () As Integer
Declare Sub setarg Lib "C:\Users\owner\Documents\Visual Studio 2013\Projects\ConsoleDLLTest\Debug\ConsoleDLLTest.dll" (myarg As Integer)
Declare Function getstrings Lib "C:\Users\owner\Documents\Visual Studio 2013\Projects\ConsoleDLLTest\Debug\ConsoleDLLTest.dll" (theStrings As String, length As Integer) As Integer
Declare Function countstrings Lib "C:\Users\owner\Documents\Visual Studio 2013\Projects\ConsoleDLLTest\Debug\ConsoleDLLTest.dll" (ByVal list As String) As Integer
Declare Function c_countstrings Lib "C:\Users\owner\Documents\Visual Studio 2013\Projects\ConsoleDLLTest\Debug\ConsoleDLLTest.dll" (ByVal list As String) As Integer
Declare Function DLLencode Lib "C:\Users\owner\Documents\Visual Studio 2013\Projects\SideloadDLL2\Debug\SideloadDLL2.dll" (ByVal filein As String, ByVal fileout As String) As Integer
Declare Function DLLdecode Lib "C:\Users\owner\Documents\Visual Studio 2013\Projects\SideloadDLL2\Release\SideloadDLL2.dll" (ByVal filesin As String, ByVal fileout As String, ByVal md5 As String, ByVal filesize As Long) As Integer

Sub testtwo()
    Dim val As Integer
    val = returntwo
    Debug.Print val
    
    setarg (val)
    Debug.Print val
End Sub

Sub teststringarr()
    Debug.Print "start"
    Dim totLength As Integer
    Dim theStrings(3) As String
    theStrings(0) = "one"
    theStrings(1) = "two"
    theStrings(2) = "foo"
    totLength = getstrings(theStrings(0), 3)
    
    Debug.Print totLength
End Sub

Sub stringdelim()
    Debug.Print "start stringdelim"
    Dim thelist As String
    thelist = "tom\file1.bin;tom\file2.bin"
    Dim count As Integer
    count = c_countstrings(thelist)
    Debug.Print count
End Sub

Sub sldencodetest()
    Debug.Print "Start sldencodetest"
    Dim filein As String
    Dim fileout As String
    filein = "C:\Users\owner\Downloads\stuff.zip"
    fileout = "C:\Users\owner\Downloads\stuff.sld"
    Dim val As Integer
    val = DLLencode(filein, fileout)
    If val > 0 Then
        Debug.Print "Success"
    Else
        Debug.Print "Fail"
    End If
    
    Debug.Print "End"
End Sub

Sub slddecodetest()
    Debug.Print "Start decode test"
    Dim filesin As String
    Dim fileout As String
    Dim filesize As Long
    Dim md5 As String
    ' ; delimited string of files, see dll code
    filesin = "C:\Users\owner\Downloads\pay140-1o3.png;C:\Users\owner\Downloads\pay140-2o3.png;C:\Users\owner\Downloads\pay140-3o3.png"
    fileout = "C:\Users\owner\Downloads\payload.zip"
    filesize = 247088
    md5 = "a5a24c8a80c2a12e13dffdd91cbdf8cb"
    Dim val As Integer
    val = DLLdecode(filesin, fileout, md5, filesize)
    If val > 0 Then
        Debug.Print "Success"
    Else
        Debug.Print "Fail"
    End If
    
    Debug.Print "End"
End Sub
