Home > database >  Pb call external DLLS, through an error, try so hard!!!!! Where is the down ~ ~ ~ ~
Pb call external DLLS, through an error, try so hard!!!!! Where is the down ~ ~ ~ ~

Time:09-27

1. The PB DLL call Delphi development, was introduced into dynamic array,
 
The function getdata (a: array of pchar) : integer; Stdcall;
Var
I: Integer;
//STR: string;
The begin
Result:=0;
For I:=Low to High (a) (a) do
The begin
//STR=StrPas (a [I]);
Showmessage (a [I]);
The end;
Result:=1;
The end;


2. In the external function declarations in pb
The function int getdata (string [] a) LIBRARY "F: \ pbtest \ test DLL"

3. The PB is called:
Int li
String a []={' jerry ', 'still,' and 'joho}

Li=getdata (a)

Messagebox (' ', a string (li))


4. The error message
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
PB90. EXE - application error
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
X00060d00 0 x02c84ad7 instruction references of "0" memory, the memory not to "read",


To terminate the program, please click "ok",
To debug the program, please click "cancel",
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Determine to cancel
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

CodePudding user response:

It to the array size specified

CodePudding user response:

Top post innocent!!!!!!

CodePudding user response:

reference 1st floor xys_777 response:
that give an array of specified size

PB when this statement is not, the consult in PB how to specify the
String a []={' jerry ', 'still,' and 'joho}

CodePudding user response:

In the declaration and calls all try add a ref

CodePudding user response:

LIBRARY function int getdata (ref string a) "F: \ pbtest \ test DLL"
Look at this statement?

CodePudding user response:

Borlndmm. DLL copied to use program directory to see see!

CodePudding user response:

Delphi arrays and PB is not a concept, the original poster in other ways,

CodePudding user response:

Waiting for the ace to explain
  • Related