暗
暗夜中独舞
Unregistered / Unconfirmed
GUEST, unregistred user!
我翻译过来老是出现数据对齐的错误。
主要是DownInfo.AppInfoS这个数据有错误估计,DownInfo.AppInfoS.appname是空的呀。请大家帮忙看看吧
C的代码如下:
typedef struct {
char ProgFile[255]
char ParaFile[255];
char DataFile[255];
char OtherFile[255];
char Type ;
char AppSum[3]; char *AppInfoS;
}DownInfo_M;
typedef struct
{
char app_name[20];
char app_edition[32];
char app_update[2];
char app_para_update[2];
char app_down_time[14];
char app_update_time[14];
char app_Enable[2];
char other[14];
}app_info_req;
DownInfo_M m_stDownfile
app_info_req m_stAppInfoReq;
char acRet[100];
memset(&m_stDownfile, 0, sizeof(DownInfo_M));
memset(&m_stAppInfoReq, 0, sizeof(app_info_req));
m_stDownfile.AppInfoS = &m_stAppInfoReq;
strcpy(m_stDownfile.OtherFile, "D://TMS//File")
m_stDownfile.AppSum[2] = 0x31;
strcpy(m_stAppInfoReq.app_name, "app")
m_stAppInfoReq.app_update[1] = 0x01;
我翻译的如下:
TAppInfoReq = record
AppName: array[0..19] of char
AppEdition: array[0..31] of char
AppUpdate: array[0..1] of char
AppParaUpdate: array[0..1] of char
AppDownTime: array[0..13] of char
AppUpdateTime: array[0..13] of char
AppEnable: array[0..1] of char
Other: array[0..13] of char
end;
TDownInfo = record
ProgFile: array[0..254] of char
ParaFile: array[0..254] of char
DataFile: array[0..254] of char
OtherFile: array[0..254] of char
DownType: char
AppSum: array[0..2] of char
AppInfoS: pchar
end;
ZeroMemory(@AppInfoReq, SizeOf(TAppInfoReq));
ZeroMemory(@DownInfo, SizeOf(TDownInfo));
strcopy(AppInfoReq.AppName, 'app');
AppInfoReq.AppUpdate[1] := chr($01);
AppInfoReq.AppParaUpdate[1] := chr($00);
DownInfo.AppInfoS := pchar(@AppInfoReq);
strcopy(DownInftherFile, '....');
DownInfo.AppSum[2] := chr($31);
主要是DownInfo.AppInfoS这个数据有错误估计,DownInfo.AppInfoS.appname是空的呀。请大家帮忙看看吧
C的代码如下:
typedef struct {
char ProgFile[255]
char ParaFile[255];
char DataFile[255];
char OtherFile[255];
char Type ;
char AppSum[3]; char *AppInfoS;
}DownInfo_M;
typedef struct
{
char app_name[20];
char app_edition[32];
char app_update[2];
char app_para_update[2];
char app_down_time[14];
char app_update_time[14];
char app_Enable[2];
char other[14];
}app_info_req;
DownInfo_M m_stDownfile
app_info_req m_stAppInfoReq;
char acRet[100];
memset(&m_stDownfile, 0, sizeof(DownInfo_M));
memset(&m_stAppInfoReq, 0, sizeof(app_info_req));
m_stDownfile.AppInfoS = &m_stAppInfoReq;
strcpy(m_stDownfile.OtherFile, "D://TMS//File")
m_stDownfile.AppSum[2] = 0x31;
strcpy(m_stAppInfoReq.app_name, "app")
m_stAppInfoReq.app_update[1] = 0x01;
我翻译的如下:
TAppInfoReq = record
AppName: array[0..19] of char
AppEdition: array[0..31] of char
AppUpdate: array[0..1] of char
AppParaUpdate: array[0..1] of char
AppDownTime: array[0..13] of char
AppUpdateTime: array[0..13] of char
AppEnable: array[0..1] of char
Other: array[0..13] of char
end;
TDownInfo = record
ProgFile: array[0..254] of char
ParaFile: array[0..254] of char
DataFile: array[0..254] of char
OtherFile: array[0..254] of char
DownType: char
AppSum: array[0..2] of char
AppInfoS: pchar
end;
ZeroMemory(@AppInfoReq, SizeOf(TAppInfoReq));
ZeroMemory(@DownInfo, SizeOf(TDownInfo));
strcopy(AppInfoReq.AppName, 'app');
AppInfoReq.AppUpdate[1] := chr($01);
AppInfoReq.AppParaUpdate[1] := chr($00);
DownInfo.AppInfoS := pchar(@AppInfoReq);
strcopy(DownInftherFile, '....');
DownInfo.AppSum[2] := chr($31);