- Luca Militello
- PowerBuilder
- Tuesday, 6 November 2018 02:55 PM UTC
Hi,
i have a problem calling a .dll external function from Powerbuilder 12.5
This is the situation:
The function i have to call required two data structure parameters, defined in the reference guide as:
typedef struct
{ char Amount[8+1];
char ECRId[8+1];
char PaymentType[1+1];
char TerminalId[8+1];
.
.
.} TECRData;
another one is TPOSData with all char var datatype as TECRData
there is the IAE17AX_Status function, defined as:
int IAE17AX_Status(TECRData *ECRData, TPOSData *POSData);
in PB global external function session i defined the function in PB:
FUNCTION int IAE17AX_Status(ref TECRData ECRData, ref TPOSData POSData) library "IAE17.dll" alias for "IAE17AX_Status;ansi"
and the TECRData and TPOSData structure using string type for all the fields defined char in the reference guide:
global type tecrdata from structure
string amount
string ecrid
string paymenttype
string terminalid
string contract
string preauthorizationcode
string stan
string ticket2ecr
...
end type
Tha application crash while i trying to call the function int IAE17AX_Status:
TECRData ECRData
TPOSData POSData
TransactionResult = IAE17AX_Status(ECRData, POSData)
After several attempts i could speak with the .dll productor and he said me that the problem is that the string parameter of the structures ECRData and POSData are dynamic, while the .dll function expect fixed lenght string parameters.
In powerbuilder is not possibile defining a fixed length string (es. ls_string(10)), and is not enough initializating the string variables with the correct lenght (in the pb script i do this by the space function (ECRData.amount =space(8)).
They say that absolutely the variables maust be fixed lenght.
Is there anyone can help me?
Thank you very much
Luca Militello
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.