Home > Back-end >  Delphi call C dynamic library, the incoming record pointer type, outgoing, too, but in return lead t
Delphi call C dynamic library, the incoming record pointer type, outgoing, too, but in return lead t

Time:09-22

Delphi call C dynamic library, the incoming record pointer type, outgoing, too, but in return parameter analytic result in my application crash


AIn=^ AIn.
Ain=record



Bout=^ Bout.
Bout=record

- the method of dynamic link library
Type
Utrans=procedure (com: integer; Ain: pointer; Bout: pointer); Stdcall;


I now also initialize a pointer, use GetMem FillChar, finally release FreeMem
But still won't do, the feeling of C dynamic libraries take my incoming pointer does other, lead to my application, I don't know what I said right, anyone know

CodePudding user response:

It depends on the C function prototype,

CodePudding user response:

reference 1st floor DelphiGuy response:
it depends on the C function prototype,

C code is others, not to see

CodePudding user response:

.h or document is certainly some, how else do you know this:
- the method of dynamic link library
Type
Utrans=procedure (com: integer; Ain: pointer; Bout: pointer); Stdcall;

CodePudding user response:

reference DelphiGuy reply: 3/f
h or document is certainly some, how else do you know this:
- the method of dynamic link library
Type
Utrans=procedure (com: integer; Ain: pointer; Bout: pointer); Stdcall;


Have the document is written according to the document

CodePudding user response:

If
Type
Utrans=procedure (com: integer; Ain: pointer; Bout: pointer); Stdcall;
Is the invocation of the method given in the document, estimate or what questions do you have the calling code,

CodePudding user response:

In and out record, in the C and Delphi is how to define?