How does delphi Call DLL Functions (C Language)? Delphi/Windows SDK/API
Http://www.delphi2007.net/DelphiAPI/html/delphi_20061109111537269.html
Function prototype (c ):
Function Definition:
Long getbasicinfo_block (lparam preserved, struct log_basicinfoarray * plgbas );
Parameters:
Preserved: unused
Plgbas: basic information (output)
Struct log_basicinfoarray {
Char BDOC [10];
Char bid [18];
Char bname [20];
Char bsex;
Char baddress [60];
Char bvehicletype [4];
Char btel [16];
Long bfirsttestdate;
Long bavailabledate; // the issuance date, for example, 20041202
Long breleasedate; // valid date, such as 20041202
};
How to reference record in Delphi and how to compare struct; (char type, what should be done in Delphi)
Help!
Type
Tlog_basicinfoarray = record
BDOC: array [0 .. 9] of char;
Bida: array [0 .. 17] of char;
Bname: array [0 .. 19] of char;
Bsex: Char;
Baddress: array [0 .. 59] of char;
Bvehicletype: array [0 .. 3] of char;
Btel [16]: array [0 .. 15] of char;
Bfirsttestdate: Double;
Bavailabledate: Double; // issuance date, for example, 20041202
Breleasedate: Double; // valid date, for example, 20041202
End;
Function getbasicinfo_block (preserved: longint; plgbas: plog_basicinfoarray): Double; stdcall; External 'dll name'
Try this
Type
Plog_basicinfoarray = ^ tlog_basicinfoarray;
Tlog_basicinfoarray = packed record
BDOC: array [0 .. 9] of char;
Bida: array [0 .. 17] of char;
Bname: array [0 .. 19] of char;
Bsex: Char;
Baddress: array [0 .. 59] of char;
Bvehicletype: array [0 .. 3] of char;
Btel [16]: array [0 .. 15] of char;
Bfirsttestdate: longint;
Long bavailabledate: longint; // card issuance date, for example, 20041202
Long breleasedate: longint; // valid date, such as 20041202
End;
Function getbasicinfo_block (preserved: longint; plgbas: plog_basicinfoarray): integer; stdcall