Home > database >  Pb how to call the function parameter hexadecimal
Pb how to call the function parameter hexadecimal

Time:09-25

External function prototype is
Int DF_AuthPro (int hReader, stDFAuth pDFAuth);
The pDFAuth structure definition:
Typedef struct {
BYTE DFAID [3].
BYTE KeyNo;
BYTE PsamKeyType;
BYTE PsamKeyIndex;
BYTE PsamAPP;
}

In c # routines that call
StDFAuth stDFAuth=new stDFAuth ();
StDFAuth. DFAID=new byte [] {0 x01, 0 x00 to 0 x00};
StDFAuth. KeyNo=0 x01;
StDFAuth. PsamAPP=0 x11;
StDFAuth. PsamKeyIndex=0 x01;
StDFAuth. PsamKeyType=0 x01;

ReadCard. DF_AuthPro (hReader stDFAuth);

How to call in pb?

CodePudding user response:

Disclaimer:
The function of integer DF_AuthPro (integer hReader, stDFAuth pDFAuth) library "XXX. DLL
"
Call like c #.

CodePudding user response:

The building Lord, please understand, value is a decimal or hexadecimal meaningless for computer, the computer is only 2 right to base a bit, so called decimal and hexadecimal is in order to comply with our human nature habit to appear in the computer, so the following two assignment means is equivalent to the computer, no difference:
Int a=0 x11;
Int a=17;
So call a function, the parameters in the values you use hexadecimal value assignment and decimal value assignment is no different from, as long as the two Numbers is equal,

CodePudding user response:

reference 1st floor xuam response:
statement:
The function of integer DF_AuthPro (integer hReader, stDFAuth pDFAuth) library "XXX. DLL
"
Call like c #.


StDFAuth how to define, I use the char, long type, is an error, says parameter type is wrong,

CodePudding user response:

Stdfauth is a structure, you must first define the structure, structure of byte type int is used to replace, assignment to convert hexadecimal for decimal, such as 0 x01, converted into 1
And as stdfauth. Dfaid={0, 1}

CodePudding user response:

reference 4 floor yyoinge response:
stdfauth is a structure, you must first define the structure, structure of byte type int is used to replace, assignment to convert hexadecimal for decimal, such as 0 x01, converted into 1
And as stdfauth. Dfaid={0, 1}

I know stdfauth's structure, structure of byte type int is used to replace, the incoming function times wrong, said type, with long, char instead is an error,
Structure I am the following definition

Global type stdfauth from structure
Character dfaid [3]
Character keyno
Character psamkeytype
Character psamkeyindex
Character psamapp
End type

Incoming assignment before the following
Istr_stdfauth. DFAID [1]=string (asc (' 01))
Istr_stdfauth. DFAID [2]=string (asc (' 00 '))
Istr_stdfauth. DFAID [3]=string (asc (' 00 '))
Istr_stdfauth. KeyNo=string (asc (' 01))
Istr_stdfauth. PsamAPP=string (asc (" 11 "))
Istr_stdfauth. PsamKeyIndex=string (asc (' 01))
Istr_stdfauth. PsamKeyType=string (asc (' 01))

The
Ll_rtn=DF_AuthPro (il_handle istr_stdfauth)
Error:
Error: the Specified argument type differs from the required argument type at runtime Dll function in df_authpro. (invalid stack pointer on the return from the function call) at line 33 function in of_drrz of object invo_proxy.

Also tried definition structure with int
Global type stdfauth from structure
The integer dfaid [3]
The integer keyno
The integer psamkeytype
The integer psamkeyindex
The integer psamapp
End type

Incoming assignment before the following
Istr_stdfauth. DFAID [1]=1
Istr_stdfauth. DFAID [2]=0
Istr_stdfauth. DFAID [3]=0
Istr_stdfauth. KeyNo=1
Istr_stdfauth. PsamAPP=17
Istr_stdfauth. PsamKeyIndex=1
Istr_stdfauth. PsamKeyType=1

The
Ll_rtn=DF_AuthPro (il_handle istr_stdfauth)

And at the same fault,

In addition, the manufacturer to the function declaration is as follows:
Function of complete Desfire card read and write, processing operations such as certification before
Entrance parameters hReader: handle operation, return value for LinkReaderPro
BlockNo: block number
ASCII string Inbuf: input, ends with a 0 x00. Containing 0 x00 length is 7 * 2 + 1=15 bytes
By the following structure to 1 byte hex into 2 bytes ASCII characters, additional 0 x00.
Typedef struct {
BYTE DFAID [3].//Desfire aid
BYTE KeyNo;//DesfireKeyNo
BYTE PsamKeyType;//psam Key use
BYTE PsamKeyIndex;//psam Key index
BYTE PsamAPP;//psam application type
} stDFAuth

Export parameter 0: success
Other: error code

CodePudding user response:

What version of the PB with?
Above the PB10 try:
The function of integer DF_AuthPro (integer hReader, stDFAuth pDFAuth) library "XXX. DLL" Alias "DF_AuthPro; ANSI
"
Then PB data type is byte.

CodePudding user response:

There is a for after Alias,
Ha ha,,,

CodePudding user response:

Pb8, impossible to this program to upgrade the entire system, I'll find the information in the pb use corresponding byte, char,,

CodePudding user response:

Please expert help,
  • Related