delphi2007 教程

delphi2007 教程

首页 新随笔 联系 聚合 管理
  1013 Posts :: 0 Stories :: 28 Comments :: 0 Trackbacks
delphi怎么调用DLL函数(C语言) Delphi / Windows SDK/API
http://www.delphi2007.net/DelphiAPI/html/delphi_20061109111537269.html
函数原型(C):  
  函数定义:  
  long   GetBasicInfo_Block(LPARAM   pReserved,struct   Log_BASICINFOARRAY   *pLgBas);  
  参数:  
  pReserved:未用  
  pLgBas:基本信息内容(输出)  
  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; //   发卡日期,如20041202  
  long   bReleaseDate; //   有效日期,如20041202  
   
  };  
   
   
  在delphi中怎么引用     Record   怎么余struct   对应;(char类型,到delphi中应是怎样的)  
 

来人救命啊!

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; //   发卡日期,如20041202  
  bReleaseDate:Double; //   有效日期,如20041202  
  end;  
   
  function   GetBasicInfo_Block(pReserved:LongInt;pLgBas:PLog_BASICINFOARRAY):Double;stdcall;external   'DLL   name'  
   
  这个试试  
 

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; //   发卡日期,如20041202  
  long   bReleaseDate:   Longint; //   有效日期,如20041202  
  end;  
   
  function   GetBasicInfo_Block(pReserved:LongInt;pLgBas:PLog_BASICINFOARRAY):integer;stdcall  
 

posted on 2009-04-08 09:10 delphi2007 阅读(277) 评论(0)  编辑 收藏 引用
只有注册用户登录后才能发表评论。