Z zsmail Unregistered / Unconfirmed GUEST, unregistred user! 2001-05-26 #1 在调用C++编写得DLL时,函数参数中自定义的结构类型,在Delphi中调用时该怎样表示? 是否是在Delphi也定义同样的结构,如果新结构字段名与原结构不同是否可以?
T tjhg Unregistered / Unconfirmed GUEST, unregistred user! 2001-05-27 #2 例: C++: typedef enum _ACTER_SWITCH_OPERATION { RECCTL_RESET, RECCTL_SET, RECCTL_GET } ACTER_SWITCH_OPERATION, *PACTER_SWITCH_OPERATION; delphi写法: type ACTER_SWITCH_OPERATION(RECCTL_RESET,RECCTL_SET,RECCTL_GET); pACTER_SWITCH_OPERATION=^ACTER_SWITCH_OPERATION
例: C++: typedef enum _ACTER_SWITCH_OPERATION { RECCTL_RESET, RECCTL_SET, RECCTL_GET } ACTER_SWITCH_OPERATION, *PACTER_SWITCH_OPERATION; delphi写法: type ACTER_SWITCH_OPERATION(RECCTL_RESET,RECCTL_SET,RECCTL_GET); pACTER_SWITCH_OPERATION=^ACTER_SWITCH_OPERATION
Z zsmail Unregistered / Unconfirmed GUEST, unregistred user! 2001-05-28 #3 c++: typedef struct {char[100] a; int type; }test delphi中可否写成: type test=record achar; type1:integer; //因为type是关键字 end;
c++: typedef struct {char[100] a; int type; }test delphi中可否写成: type test=record achar; type1:integer; //因为type是关键字 end;
Z zhengjunfeng Unregistered / Unconfirmed GUEST, unregistred user! 2001-05-30 #5 我测试了一下,没有问题。 编译后对于静态变量是根据地址码来进行存储。 只要分配的内存大小一样,就不会有问题。