如何将这段C语法转换成delphi语法?

hyjiang 2009-01-02 03:50:29
#ifdef _WIN32
#define STDCALL __stdcall
#else
#define STDCALL
#endif
#ifndef SDTAPI_
#define SDTAPI_
#ifdef __cplusplus
extern "C"{
#endif

#pragma pack(1)
typedef struct tagIDCardData{
char Name[32];
char Sex[4];
char Nation[6];
char Born[18];
char Address[72];
char IDCardNo[38];
char GrantDept[32];
char UserLifeBegin[18];
char UserLifeEnd[18];
char reserved[38];
char PhotoFileName[255];
}IDCardData;

#pragma pack()


int STDCALL Syn_GetCOMBaud(int iComID,unsigned int *puiBaud);
int STDCALL Syn_SetCOMBaud(int iComID,unsigned int uiCurrBaud,unsigned int uiSetBaud);
int STDCALL Syn_OpenPort(int iPortID);
int STDCALL Syn_ClosePort(int iPortID);


int STDCALL Syn_GetSAMStatus(int iPortID,int iIfOpen);
int STDCALL Syn_ResetSAM(int iPortID,int iIfOpen);
int STDCALL Syn_GetSAMID(int iPortID,unsigned char *pucSAMID,int iIfOpen);
int STDCALL Syn_GetSAMIDToStr(int iPortID,char *pcSAMID,int iIfOpen);


int STDCALL Syn_StartFindIDCard(int iPortID,unsigned char *pucManaInfo,int iIfOpen);
int STDCALL Syn_SelectIDCard(int iPortID,unsigned char *pucManaMsg,int iIfOpen);
int STDCALL Syn_ReadMsg(int iPortID,int iIfOpen,IDCardData *pIDCardData);


int STDCALL Syn_SendSound(int iCmdNo);
void STDCALL Syn_DelPhotoFile();
#ifdef __cplusplus
}
#endif
#endif
}
...全文
94 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
waizqfor 2009-01-10
  • 打赏
  • 举报
回复
帮顶了
nj_dobetter 2009-01-10
  • 打赏
  • 举报
回复
呵呵。顶!
huchangbo 2009-01-10
  • 打赏
  • 举报
回复
感觉自己学得太少了
freeheart_td 2009-01-03
  • 打赏
  • 举报
回复
{$A1}
typedef struct tagIDCardData{
char Name[32];
char Sex[4];
char Nation[6];
char Born[18];
char Address[72];
char IDCardNo[38];
char GrantDept[32];
char UserLifeBegin[18];
char UserLifeEnd[18];
char reserved[38];
char PhotoFileName[255];
}IDCardData;

type IDCardData = record
Name: array [0..32-1] of char;
....
end;
{$A-}

或者

type
IDCardata = packed record
end;
跟上面的一个意思


int STDCALL Syn_GetCOMBaud(int iComID,unsigned int *puiBaud);
function Syn_GetCOMBaud(iComID: Integer; puiBaud: PInteger): Integer; stdcall;
lhhui 2009-01-03
  • 打赏
  • 举报
回复
不太明白。帮你顶
yc_8301 2009-01-02
  • 打赏
  • 举报
回复
Delphi中好像不能使用#pragma 关键字进行数据段共享。。。
建议还是去Delphi版 求助....

69,371

社区成员

发帖
与我相关
我的任务
社区描述
C语言相关问题讨论
社区管理员
  • C语言
  • 花神庙码农
  • 架构师李肯
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧