Home > database >  For help! The external function called
For help! The external function called

Time:09-25

For help! C + + do a function in PB how to define the array parameters? All hope ace glad!

//can work: ASC string into an array of bytes
//input parameters: * ASC string, receive buffer length * DataLen input, output actual data length
//output parameters: * ByteArray containing an array of bytes
//return back value: 0 transformation is successful, other: error code
//description: * ASC if passed down is NULL, cause Windows Read memory error
The function StrASCToByteArray (ASC: Pchar; Var ByteArray containing: byte; Var DataLen: LongWord) : LongWord; Stdcall; External 'DataConv. DLL'

CodePudding user response:

String ls_str []

CodePudding user response:

Long StrASCToByteArray (char ASC, ref string ByteArray containing, long DataLen)
Or
Long StrASCToByteArray (char ASC, ref char ByteArray containing [], long DataLen)

Call:
Char ls_asc
Long ll_len
String ls_byte
Ls_asc=...
Ll_len=...
Ls_byte=space (ll_len)
StrASCToByteArray (ls_asc ls_byte, ll_len)

StrASCToByteArray

  • Related