B
boycxd
Unregistered / Unconfirmed
GUEST, unregistred user!
C++代码如下:
struct SCHead {
WORD m_nType;
char m_cStatus;
long m_lIndex;
};
struct SC_PankouAsk {
SCHead m_Head;
StockID m_sID;
long m_lDate;
};
typedef struct tagStockID {
WORD m_wMarket;
short m_nIndex;
} StockID;
DELPHI代码调用如下:
var
pp:^SC_PankouAsk;
tmpbuf: array[0..1024] of char;
m_lAskIndex:integer;
nIndex:integer;
wMarket:integer;
nAskLen:integer;
begin
m_lAskIndex := 1;
nIndex := 0;
wMarket := 0;
nAskLen :=0;
new(pp);
pp^.m_Head.m_nType:= SC_PANKOU;
pp^.m_Head.m_cStatus := 1;
pp^.m_Head.m_lIndex := m_lAskIndex;
pp^.m_sID.m_nIndex := nIndex;
pp^.m_sID.m_wMarket := wMarket;
pp^.m_lDate := strtoint(formatdatetime('yyyymmdd',now));
nAskLen:=sizeof(SC_PankouAsk)
//move(pp^, tmpbuf, sizeof(pp));
if ( nAskLen > 0 ) then
SCAskData(@pp,nAskLen);
end;
怎么出错呢。请问,上面的C++代码如何转化为DLPHI然后实现调用。
struct SCHead {
WORD m_nType;
char m_cStatus;
long m_lIndex;
};
struct SC_PankouAsk {
SCHead m_Head;
StockID m_sID;
long m_lDate;
};
typedef struct tagStockID {
WORD m_wMarket;
short m_nIndex;
} StockID;
DELPHI代码调用如下:
var
pp:^SC_PankouAsk;
tmpbuf: array[0..1024] of char;
m_lAskIndex:integer;
nIndex:integer;
wMarket:integer;
nAskLen:integer;
begin
m_lAskIndex := 1;
nIndex := 0;
wMarket := 0;
nAskLen :=0;
new(pp);
pp^.m_Head.m_nType:= SC_PANKOU;
pp^.m_Head.m_cStatus := 1;
pp^.m_Head.m_lIndex := m_lAskIndex;
pp^.m_sID.m_nIndex := nIndex;
pp^.m_sID.m_wMarket := wMarket;
pp^.m_lDate := strtoint(formatdatetime('yyyymmdd',now));
nAskLen:=sizeof(SC_PankouAsk)
//move(pp^, tmpbuf, sizeof(pp));
if ( nAskLen > 0 ) then
SCAskData(@pp,nAskLen);
end;
怎么出错呢。请问,上面的C++代码如何转化为DLPHI然后实现调用。