Using the Delphi call DLL code below CThe unit MatRead;
Interface Type Pchar=^ AnsiChar; The function ReadMatSize (path: PChar) : Integer; Cdecl; Implementation The function ReadMatSize; External 'MatReadLib. DLL' name 'ReadMatSize'; End.
Type TForm1=class (TForm) Testmat: TButton; Procedure TestmatClick (Sender: TObject); Private {Private declarations} Public {Public declarations} end;
Var Form1: TForm1; Tdata: PDouble;
Implementation
{$R *. DFM} USES the MatRead; Procedure TForm1. TestmatClick (Sender: TObject); Var S: AnsiString. ArrChar: an array of Char [1.. 1024]. P: PChar; The begin S:='E: \ \ test. The mat'; P:=PChar (s); Size:=ReadMatSize (p); end;
End.
{size:=ReadMatSize (p); } this line of code Error errors for [dcc32 Error]. The main pas (33) : E2029 '(' expected but:=' found
CodePudding user response:
What is your Size here?
CodePudding user response:
You refers to compile error size: integer you are not yet defined, Pchar types Delphi bring don't define Your calling convention is cdecl this appointment with DLL developer divide is usually stdcall
CodePudding user response:
The definition of a variable is size Used to record the length of the