请交将VC struct 类型转换为DELPHI record 类型(100分)

  • 主题发起人 八八口
  • 开始时间

八八口

Unregistered / Unconfirmed
GUEST, unregistred user!
为了调用VC写的DLL,需要接口转换:
typedef struct dv_tpt DV_TPT;
struct dv_tpt {
unsigned short tp_type;

DV_TPT *tp_nextp;
};
 
不就是个链表吗?
type
PDV_TPT:^dv_tpt;
dv_tpt=record
tp_type:byte;
tp_nextp:pDV_TPT;
end;
试试看行不行?
 
type
PDV_TPT = ^dv_tpt;
dv_tpt = record
tp_type: word;
tp_nextp: PDV_TPT;
end;

Note:
定义类型用 = 不是用 : ;
C/C++ 中的 unsigned short 等价于 Delphi 中的 word 而不是 byte 。
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
I
回复
0
查看
666
import
I
D
回复
0
查看
1K
DelphiTeacher的专栏
D
I
回复
0
查看
824
import
I
顶部