How does delphi Call DLL Functions (C Language)

Source: Internet
Author: User
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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.