我现在在VC6中使用MFC调用通视接口,数据结构为//行情数据
typedef struct tagRCV_REPORT_STRUCTEx
{
WORD m_cbSize; // 结构大小
TIME_TYPE m_time; // 交易时间
WORD m_wMarket; // 股票市场类型
char m_szLabel[STKLABEL_LEN]; // 股票代码,以'\0'结尾
char m_szName[STKNAME_LEN]; // 股票名称,以'\0'结尾
float m_fLastClose; // 昨收
float m_fOpen; // 今开
float m_fHigh; // 最高
float m_fLow; // 最低
float m_fNewPrice; // 最新
float m_fVolume; // 成交量
float m_fAmount; //期货_____持仓量  // 成交额
float m_fBuyPrice[3]; // 申买价1,2,3
float m_fBuyVolume[3]; // 申买量1,2,3
float m_fSellPrice[3]; // 申卖价1,2,3
float m_fSellVolume[3]; // 申卖量1,2,3
float m_fBuyPrice4; // 申买价4
float m_fBuyVolume4; // 申买量4
float m_fSellPrice4; // 申卖价4
float m_fSellVolume4; // 申卖量4
float m_fBuyPrice5; // 申买价5
float m_fBuyVolume5; // 申买量5
float m_fSellPrice5; // 申卖价5
float m_fSellVolume5; // 申卖量5
} RCV_REPORT_STRUCTEx, *PRCV_REPORT_STRUCTEx;测试大小为158
消息处理为: RCV_DATA* pHeader;
pHeader = (RCV_DATA*)lParam;
int nBufSize = pHeader->m_pReport[0].m_cbSize; //数据结构大小
PBYTE pBaseBuf = (PBYTE)&pHeader->m_pReport[0];
int i = 0;
switch(wFileType)
{
case RCV_REPORT: //实时行情数据
for (i=0;i<pHeader->m_nPacketNum;i++)
{
RCV_REPORT_STRUCTEx & Buf = *(PRCV_REPORT_STRUCTEx)(pBaseBuf + nBufSize*i);
CTime t = CTime(Buf.m_time);
CString ts = t.Format("%Y-%m-%d %H:%M:%S");
CString n = "insert into qhsj(code,name,time,newprice,fopen,flastclose,fhigh,flow,fbuyvolume,famount,fbuyprice1,fsellprice1) ";
CString m;
m.Format("values(\'%s\',\'%s\',\'%s\',%8.3f,%8.3f,%8.3f,%8.3f,%8.3f,%8.3f,%8.3f,%8.3f,%8.3f)",
Buf.m_szLabel,\
Buf.m_szName,\
ts,\
Buf.m_fNewPrice,\
Buf.m_fOpen,\
Buf.m_fLastClose,\
Buf.m_fHigh,\
Buf.m_fLow,\
Buf.m_fBuyVolume,\
Buf.m_fAmount,\
Buf.m_fBuyPrice[0],\
Buf.m_fSellPrice[0]);
                                }
                                break;
                       case RCV_FILEDATA:
                       break;
                       default:
                       break;只有最后四个数据接收是错误的,有时候还有其他的错误,
m_fAmount的数据很大,128位
有人用过么??????