Home > database >  Function name, in c # byte conversion in pb
Function name, in c # byte conversion in pb

Time:10-18

C # example
The function
[DllImport (" termb. DLL, "EntryPoint=" GetFPDate CharSet=CharSet. Ansi, SetLastError=false, CallingConvention=CallingConvention. StdCall)]
Public static extern int GetFPDate (ref byte strTmp, ref int strLen);

Byte [] ICFeatureData;
ICFeatureData=https://bbs.csdn.net/topics/new byte [1024];
GetFPDate (ref ICFeatureData [0], ref length);

In pb how to implement the code, this is my
The Function of Integer GetFPDate (Ref String strTmp, Ref Long strLen) Library 'termb. DLL' Alias For "GetFPDate; Ansi
"String ls_str
Long Length
Ls_str=Space (1024)
GetFPDateCS (ls_str, Length)

Get the value is not correct, to take on a great god

CodePudding user response:

How no one come across? Pray god to teach experience

CodePudding user response:

There is also a Byte in PB, you can try this

Or use a blob

CodePudding user response:

Byte [1024] is too big, PB no byte type (binary), it should be 1024 - bit binary
Generally an address is FFFF 16-bit binary
Advice to find similar DLL interface function, can block read (assuming GetFPDateCStmp), such as every time read a 16-bit binary

//define a numerical (decimal)
Long ll_ICFeatureDatatmp
Ll_ICFeatureDatatmp=65535//you must initialize the

GetFPDateCStmp (ll_ICFeatureDatatmp, Length)

Then through transformation (may need to be converted to hexadecimal), loop read together again

CodePudding user response:

reference nocry115 reply: 3/f
byte [1024] is too big, PB no byte type (binary), it should be 1024 - bit binary
Generally an address is FFFF 16-bit binary
Advice to find similar DLL interface function, can block read (assuming GetFPDateCStmp), such as every time read a 16-bit binary

//define a numerical (decimal)
Long ll_ICFeatureDatatmp
Ll_ICFeatureDatatmp=65535//you must initialize the

GetFPDateCStmp (ll_ICFeatureDatatmp, Length)

And then through the conversion (may need to be converted to hexadecimal), loop read together again

Thank, pb learning is not deep, the feeling is so complicated, to find a way to solve yourself

CodePudding user response:

refer to the second floor lzp_lrp response:
PB in Byte, you can try this

Or use a blob

The Function of Integer GetFPDate (Ref blob strTmp, Ref Long strLen) Library 'termb. DLL' Alias For "GetFPDate; Ansi
"The Function of Integer GetFPDate (Ref byte strTmp, Ref Long strLen) Library 'termb. DLL' Alias For "GetFPDate; Ansi
"
When performing will be an error
  • Related