I am trying to write a DLL in PB that will sort an array of strings from VB and return the sorted strings back to VB. I have this code in my PB DLL
SUB SORTSTRING ALIAS "SORTSTRING" (pSA AS DWORD) EXPORT
LOCAL l AS LONG
LOCAL u AS LONG
LOCAL vb AS DWORD
l = vbArrayLBound(psa, 1)
u = vbArrayUBound(psa, 1)
vb = vbArrayFirstElem(psa)
DIM A(l TO u) AS STRING AT vb
ARRAY SORT A$()
END SUB
and I have this declaration in VB
Declare Sub SORTSTRING Lib "my.dll" (A$())
But it is not working, can anyone see what I am doing wrong?
Thanks
SUB SORTSTRING ALIAS "SORTSTRING" (pSA AS DWORD) EXPORT
LOCAL l AS LONG
LOCAL u AS LONG
LOCAL vb AS DWORD
l = vbArrayLBound(psa, 1)
u = vbArrayUBound(psa, 1)
vb = vbArrayFirstElem(psa)
DIM A(l TO u) AS STRING AT vb
ARRAY SORT A$()
END SUB
and I have this declaration in VB
Declare Sub SORTSTRING Lib "my.dll" (A$())
But it is not working, can anyone see what I am doing wrong?
Thanks
Comment