麻烦把下列C语言函数的定义转化为Delphi的定义(100)

  • 主题发起人 主题发起人 znxia
  • 开始时间 开始时间
Z

znxia

Unregistered / Unconfirmed
GUEST, unregistred user!
麻烦哪位把下列函数CPM_InitPort和CPM_InitMaster的定义转化为delphi代码。------------------------typedef struct// canchannel{ BYTE bBoardNo; BYTE bPort;} CANChannelStruct;typedef struct cpmconfig{ BYTE AccCode[4]; BYTE AccMask[4]; BYTE BaudRate;} CPMConfigStruct;typedef struct packet{ LONGLONG MsgTimeStamps; BYTE mode; DWORD id; BYTE rtr; BYTE len; BYTE data[8];} PacketStruct;extern "C" __declspec(dllexport) WORD CALLBACK CPM_InitPort(BYTE bBoardNo,BYTE bPort,CANChannelStruct *ChannelHandle);extern "C" __declspec(dllexport) WORD CALLBACK CPM_InitMaster(CANChannelStruct *ChannelHandle, CPMConfigStruct *CanConfig, WORD wSDOTimeout);
 
代码:
type  CANChannelStruct = record    bBoardNo:BYTE;
   bPort:BYTE;
 end;
 PCANChannelStruct = ^CANChannelStruct;
 CPMConfigStruct = record    AccCode:array[0..3] of BYTE;
   AccMask:array[0..3] of BYTE;
   BaudRate:BYTE;
 end;
   PCPMConfigStruct = ^CPMConfigStruct;
 PacketStruct = record    MsgTimeStamps:INT64;
   mode:BYTE;
   id:DWORD;
   rtr:BYTE;
   len:BYTE;
   data:BYTE;
 end;
function CPM_InitPort(bBoardNo:BYTE;bPort:BYTE;ChannelHandle:PCANChannelStruct):WORD;cdecl;function CPM_InitMaster(ChannelHandle:PCANChannelStruct;CanConfig:PCPMConfigStruct;wSDOTimeout:WORD):WORD;cdecl;
 
接受答案了.
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
I
回复
0
查看
937
import
I
I
回复
0
查看
775
import
I
后退
顶部