|
ok, new things i've done, but still not working. There's something wrong with memory:
'IN A MODULE
Public Declare Sub Compress Lib "UOEncryption.dll" (ByRef Dest() As Byte, ByRef Source() As Byte, ByRef DestSize As Integer, ByRef SrcSize As Integer)
Public Src() As Byte
Public Dst() As Byte
Public SrcLength As Integer
Public DestLength As Integer
'IN MAIN FORM
Private Sub Form_Load()
String2Array "ciao", Src()
SrcLength = 4
DestLength = 1000
Compress Dst, Src, DestLength, SrcLength
End Sub
Private Function String2Array(Text, ByRef ar() As Byte) As Long
On Error Resume Next
ReDim ar(Len(Text) - 1)
For i = 0 To Len(Text) - 1
ar(i) = Asc(Mid(Text, i + 1, 1))
Next i
End Function
When i run it says Error 49: Bad DLL calling convention. If i debug Src, DestLength and SrclLength, everything works, if I debug Dst it crashes saying memory could not be read. Someone can help?
_________________ OR
|