c++结构体delphi改写
typedefstructiodbtgi{shorts_grp;/*startgroupnumber*/shortdummy;/*dummy*/shorte_grp;/*...
typedef struct iodbtgi {
short s_grp; /* start group number */
short dummy; /* dummy */
short e_grp; /* end group number */
struct {
long n_tool; /* number of tool */
long count_value; /* tool life */
long counter; /* tool life counter */
long count_type; /* tool life counter type */
} data[5];
} IODBTGI; /* In case that the number of group is 5 */
各位大师上面的c结构体,怎麼样改写为成delphi的record啊
谢谢啦
extern "C" __declspec(dllexport)
IODBTGI * WINAPI GetTime(const char *ipaddress);
这是我c中dll的函数申明
在delphi中我要申明一个返回机构体指针的函数 应该怎麼写啊
Function GetTimeList(ip:string):^IODBTGI;
这样写编译出错啊(Identifier expected but '^' found) 展开
short s_grp; /* start group number */
short dummy; /* dummy */
short e_grp; /* end group number */
struct {
long n_tool; /* number of tool */
long count_value; /* tool life */
long counter; /* tool life counter */
long count_type; /* tool life counter type */
} data[5];
} IODBTGI; /* In case that the number of group is 5 */
各位大师上面的c结构体,怎麼样改写为成delphi的record啊
谢谢啦
extern "C" __declspec(dllexport)
IODBTGI * WINAPI GetTime(const char *ipaddress);
这是我c中dll的函数申明
在delphi中我要申明一个返回机构体指针的函数 应该怎麼写啊
Function GetTimeList(ip:string):^IODBTGI;
这样写编译出错啊(Identifier expected but '^' found) 展开
2个回答
展开全部
type
TIodbtgiData = packed record
n_tool : LongInt; //* number of tool */
count_value : LongInt; //* tool life */
counter : LongInt; //* tool life counter */
count_type : LongInt; //* tool life counter type */
end;
PIodbtgi = ^TIodbtgi;
TIodbtgi = packed record
s_grp : Word; //* start group number */
dummy : Word; //* dummy */
e_grp : Word; //* end group number */
data : array [0..4] of TIodbtgiData;
end;
var
IODBTGI : TIodbtgi;
//------------------------------------------------------------
function GetTimeList(ip : string): PIodbtgi;
TIodbtgiData = packed record
n_tool : LongInt; //* number of tool */
count_value : LongInt; //* tool life */
counter : LongInt; //* tool life counter */
count_type : LongInt; //* tool life counter type */
end;
PIodbtgi = ^TIodbtgi;
TIodbtgi = packed record
s_grp : Word; //* start group number */
dummy : Word; //* dummy */
e_grp : Word; //* end group number */
data : array [0..4] of TIodbtgiData;
end;
var
IODBTGI : TIodbtgi;
//------------------------------------------------------------
function GetTimeList(ip : string): PIodbtgi;
展开全部
type
TStruct = Record
case Integer of
0:(data:array[0..3] of LongInt);
1:(
n_tool:LongInt;
count_value :LongInt;
counter:LongInt;
count_type:Longint;
)
end;
type
iodbtgi = packed Record
s_grp :Word;
dummy :Word;
e_grp :Word;
Struct:TStruct;
end;
TStruct = Record
case Integer of
0:(data:array[0..3] of LongInt);
1:(
n_tool:LongInt;
count_value :LongInt;
counter:LongInt;
count_type:Longint;
)
end;
type
iodbtgi = packed Record
s_grp :Word;
dummy :Word;
e_grp :Word;
Struct:TStruct;
end;
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询