P
psynet123
Unregistered / Unconfirmed
GUEST, unregistred user!
vc 為:
struct STRUCT_SUBMIT_HEADER
{
STRUCT_CTKP_MSG_HEADER sHeader;
WORD wAppID;
BYTE cReSubmit_Count;
BYTE cTNO; BYTE cReserve;
BYTE cService_ChannelID;
char szReserve[6];
BYTE cService_PlatID; 
BYTE cReserve2;
BYTE cPriority_Flag; BYTE cTimeOut;
BYTE cCredibility_Transmit;
BYTE cSaveForTramSmit;
BYTE cProtocol_Type;
WORD wProtocol_Length;
STRUCT_SUBMIT_HEADER()
{
ZeroMemory(this,sizeof(STRUCT_SUBMIT_HEADER));
}
};
struct STRUCT_CMPP12_SUBMIT
{
STRUCT_CMPP12_MSG_HEADER sHeader;
__int64 n64Msg_ID;
BYTE cPk_total;
BYTE cPk_number; BYTE cRegistered_Delivery;
BYTE cMsg_Level; char szService_ID[10];
BYTE cFee_UserType;
char szFee_terminal_ID[21];
BYTE cTP_pid;
BYTE cTP_udhi;
BYTE cMsg_Fmt;
char szMsg_src[6];
char szFeeType[2]; char szFeeCode[6];
char szValid_Time[17]; 
char szAt_Time[17]; char szSrc_terminal_id[21];
BYTE cDestUsr_tl;
char szDest_terminal_ids[21];
WORD wMsg_Length;
char szMsg_Content[512];
char szReserve[8];
STRUCT_CMPP12_SUBMIT()
{
ZeroMemory(this,sizeof(STRUCT_CMPP12_SUBMIT));
}
};
struct STRUCT_SUBMIT //CTKP_SUBMIT
{
STRUCT_SUBMIT_HEADER sSubmitHeader; STRUCT_CMPP12_SUBMIT sCMPP12Submit;
STRUCT_SUBMIT()
{
ZeroMemory(this,sizeof(STRUCT_SUBMIT));
}
};
delphi我轉為:
STRUCT_SUBMIT_HEADER = ^TSTRUCT_SUBMIT_HEADER;
TSTRUCT_SUBMIT_HEADER = record
sHeader : TSTRUCT_CTKP_MSG_HEADER;
wAppID : WORD; cReSubmit_Count : BYTE;
cTNO : BYTE; cReserve : BYTE;
cService_ChannelID : BYTE;
szReserve : array[0..5] of char;
cService_PlatID : BYTE;
cReserve2 : BYTE;
cPriority_Flag : BYTE;
cTimeOut : BYTE;
cCredibility_Transmit : BYTE;
cSaveForTramSmit : BYTE;
cProtocol_Type : BYTE; wProtocol_Length : WORD;
end;
type
STRUCT_CMPP12_SUBMIT = ^TSTRUCT_CMPP12_SUBMIT;
TSTRUCT_CMPP12_SUBMIT = record
sHeader : TSTRUCT_CMPP12_MSG_HEADER ;
n64Msg_ID : int64;
cPk_total : BYTE;
cPk_number : BYTE; cRegistered_Delivery : BYTE ;
cMsg_Level : BYTE;
szService_ID : array[0..9] of Char;
cFee_UserType : BYTE;
szFee_terminal_ID : array[0..20] of Char;
cTP_pid : BYTE;
cTP_udhi : BYTE ;
cMsg_Fmt : BYTE ;
szMsg_src : array[0..5] of char; szFeeType : array[0..1] of char; szFeeCode : array [0..5] of Char;
szValid_Time : array [0..16] of Char;
szAt_Time : array [0..16] of Char; szSrc_terminal_id : array[0..20] of Char;
cDestUsr_tl : BYTE ;
szDest_terminal_ids : array[0..20] of Char;
wMsg_Length : WORD ;
szMsg_Content : array [0..511] of char;
szReserve : array [0..7] of char;
end;
type
STRUCT_SUBMIT = ^TSTRUCT_SUBMIT;
TSTRUCT_SUBMIT = record
sSubmitHeader : TSTRUCT_SUBMIT_HEADER ;
sCMPP12Submit : TSTRUCT_CMPP12_SUBMIT ;
end;
請問各位,我上面的轉換有問題嗎?為什麼她們不相等?delphi的
sizeof( TSTRUCT_SUBMIT)=720 而vc
等於 709
struct STRUCT_SUBMIT_HEADER
{
STRUCT_CTKP_MSG_HEADER sHeader;
WORD wAppID;
BYTE cReSubmit_Count;
BYTE cTNO; BYTE cReserve;
BYTE cService_ChannelID;
char szReserve[6];
BYTE cService_PlatID; 
BYTE cReserve2;
BYTE cPriority_Flag; BYTE cTimeOut;
BYTE cCredibility_Transmit;
BYTE cSaveForTramSmit;
BYTE cProtocol_Type;
WORD wProtocol_Length;
STRUCT_SUBMIT_HEADER()
{
ZeroMemory(this,sizeof(STRUCT_SUBMIT_HEADER));
}
};
struct STRUCT_CMPP12_SUBMIT
{
STRUCT_CMPP12_MSG_HEADER sHeader;
__int64 n64Msg_ID;
BYTE cPk_total;
BYTE cPk_number; BYTE cRegistered_Delivery;
BYTE cMsg_Level; char szService_ID[10];
BYTE cFee_UserType;
char szFee_terminal_ID[21];
BYTE cTP_pid;
BYTE cTP_udhi;
BYTE cMsg_Fmt;
char szMsg_src[6];
char szFeeType[2]; char szFeeCode[6];
char szValid_Time[17]; 
char szAt_Time[17]; char szSrc_terminal_id[21];
BYTE cDestUsr_tl;
char szDest_terminal_ids[21];
WORD wMsg_Length;
char szMsg_Content[512];
char szReserve[8];
STRUCT_CMPP12_SUBMIT()
{
ZeroMemory(this,sizeof(STRUCT_CMPP12_SUBMIT));
}
};
struct STRUCT_SUBMIT //CTKP_SUBMIT
{
STRUCT_SUBMIT_HEADER sSubmitHeader; STRUCT_CMPP12_SUBMIT sCMPP12Submit;
STRUCT_SUBMIT()
{
ZeroMemory(this,sizeof(STRUCT_SUBMIT));
}
};
delphi我轉為:
STRUCT_SUBMIT_HEADER = ^TSTRUCT_SUBMIT_HEADER;
TSTRUCT_SUBMIT_HEADER = record
sHeader : TSTRUCT_CTKP_MSG_HEADER;
wAppID : WORD; cReSubmit_Count : BYTE;
cTNO : BYTE; cReserve : BYTE;
cService_ChannelID : BYTE;
szReserve : array[0..5] of char;
cService_PlatID : BYTE;
cReserve2 : BYTE;
cPriority_Flag : BYTE;
cTimeOut : BYTE;
cCredibility_Transmit : BYTE;
cSaveForTramSmit : BYTE;
cProtocol_Type : BYTE; wProtocol_Length : WORD;
end;
type
STRUCT_CMPP12_SUBMIT = ^TSTRUCT_CMPP12_SUBMIT;
TSTRUCT_CMPP12_SUBMIT = record
sHeader : TSTRUCT_CMPP12_MSG_HEADER ;
n64Msg_ID : int64;
cPk_total : BYTE;
cPk_number : BYTE; cRegistered_Delivery : BYTE ;
cMsg_Level : BYTE;
szService_ID : array[0..9] of Char;
cFee_UserType : BYTE;
szFee_terminal_ID : array[0..20] of Char;
cTP_pid : BYTE;
cTP_udhi : BYTE ;
cMsg_Fmt : BYTE ;
szMsg_src : array[0..5] of char; szFeeType : array[0..1] of char; szFeeCode : array [0..5] of Char;
szValid_Time : array [0..16] of Char;
szAt_Time : array [0..16] of Char; szSrc_terminal_id : array[0..20] of Char;
cDestUsr_tl : BYTE ;
szDest_terminal_ids : array[0..20] of Char;
wMsg_Length : WORD ;
szMsg_Content : array [0..511] of char;
szReserve : array [0..7] of char;
end;
type
STRUCT_SUBMIT = ^TSTRUCT_SUBMIT;
TSTRUCT_SUBMIT = record
sSubmitHeader : TSTRUCT_SUBMIT_HEADER ;
sCMPP12Submit : TSTRUCT_CMPP12_SUBMIT ;
end;
請問各位,我上面的轉換有問題嗎?為什麼她們不相等?delphi的
sizeof( TSTRUCT_SUBMIT)=720 而vc
等於 709