有这样一个数据结构 DeliverResp *pDeliverResp
其中pDeliverResp结构如下
sMsgID Char(11)
nMsgFormat Int
sSrcrmID Char(22)
sDestTermID Char(22)
nIsReply Char(22)
nMsgLen Int
sMsgContent Char(252)
我是这样对应的
msgp= record
sMsgID:array [0..11] of char ;
nMsgFormat:integer;
sRecvTime:array [0..16] of char ;
sSrcrmID:array [0..22] of char ;
sDestTermID:array [0..22] of char ;
nIsReply:array [0..22] of char ;
nMsgLen:integer;
sMsgContent: array [0..252] of char ;
end;
tpDeliverResp=^msgp;
为什么用的时候会出错?
其中pDeliverResp结构如下
sMsgID Char(11)
nMsgFormat Int
sSrcrmID Char(22)
sDestTermID Char(22)
nIsReply Char(22)
nMsgLen Int
sMsgContent Char(252)
我是这样对应的
msgp= record
sMsgID:array [0..11] of char ;
nMsgFormat:integer;
sRecvTime:array [0..16] of char ;
sSrcrmID:array [0..22] of char ;
sDestTermID:array [0..22] of char ;
nIsReply:array [0..22] of char ;
nMsgLen:integer;
sMsgContent: array [0..252] of char ;
end;
tpDeliverResp=^msgp;
为什么用的时候会出错?
解决方案 »
- 怎样让程序跳到前端显示?
- 大家来看看,为什么我给panel新增的keydown事件无法捕捉到4个方向健?
- c语言代码请能帮我翻译成DELPHI
- 求汉字转换成UTF8编码的方法(送50分)!!!
- 如果实现快速的端口扫描???
- 一个绝对酷,而绝对让你兴奋的问题(OLE):
- 請問如何在不修改數據的情況下,輸出與數據對應的規則數據
- DELPHI查询数据库提取结果的问题
- 那里有oracle7的书阿
- Inno 生成的安装文件,英文 安装过程中取消安装,出现的Exit Setup对话框的按钮是中文的
- 老冯终于穿上Five条panties.特开Virgin仓以答谢各位社员.老冯潜水前之作同期公布。
- 请教绘图问题
msgp = packed record // packed改变对齐方式
sMsgID: array [0..11 - 1] of Char; //0..11是12个元素,所以要-1
nMsgFormat: Integer;
sRecvTime: array [0..16 - 1] of Char;
sSrcrmID: array [0..22 - 1] of Char;
sDestTermID: array [0..22 - 1] of Char;
nIsReply: array [0..22 - 1] of Char;
nMsgLen: Integer;
sMsgContent: array [0..252 - 1] of Char;
end;
是用getmem(tpDeliverResp,sizeof(tpDeliverResp))
还是用new(tpDeliverResp);
如果是多个数据,看成列表需要用
GetMem(tpDeliverResp, SizeOf(tpDeliverResp) * Count)
只是一个元素就用New(tpDeliverResp)
msgp= record
sMsgID:array [0..11] of char ;
nMsgFormat:integer;
sRecvTime:array [0..16] of char ;
sSrcrmID:array [0..22] of char ;
sDestTermID:array [0..22] of char ;
nIsReply:array [0..22] of char ;
nMsgLen:integer;
sMsgContent: array [0..252] of char ;
end;