LPSAFEARRAY __stdcall Decode(char* data){
#pragma EXPORT
LPSAFEARRAY ret = NULL;
std::vector<unsigned char> vch;
if(data!=NULL && strlen(data) > 0 ){
if(DecodeBase58(data, vch)){
HRESULT h = PackBytes(vch.size(),(const BYTE*)&vch[0], &ret);
if(h == S_OK) return ret;
}
}
return NULL;
}
Private Declare Function Decode Lib "b58.dll" (ByVal encStr As String) As Byte()
dim b() as byte
b() = Decode(buf)
If AryIsEmpty(b) Then
MsgBox "Decode failed"
Else
MsgBox "Decoded data: " & vbCrLf & _
"Str Data = " & StrConv(b, vbUnicode, &H409) & vbCrLf & _
"Hex Data= " & b2h(b)
End If