不熟悉c++,弱弱的问一下:在AddinDemo例程的OnButtonGetData() 函数中,如何读取全部K线数据?先谢谢啦。
void CMainWindowDlg::OnButtonGetData()
{
PCALCINFO stData = {0};
stData.m_dataType = DAY_DATA;
stData.m_bIsPow = 1;
stData.m_wMarket = 'HS';
strcpy(stData.m_szLabel,"600000");
if(g_pMainFormework->GetDataInfo(&stData))
{
CString strText;
//strText.Format("已取到 %d 个数据",stData.m_nNumData);
strText.Format("数据:%f",stData.m_pMainData->m_fClose); //这样写只能读取第一根K线的收盘数据,如何读第n根呢?
AfxMessageBox(strText);
}
}
void CMainWindowDlg::OnButtonGetData()
{
PCALCINFO stData = {0};
stData.m_dataType = DAY_DATA;
stData.m_bIsPow = 1;
stData.m_wMarket = 'HS';
strcpy(stData.m_szLabel,"600000");
if(g_pMainFormework->GetDataInfo(&stData))
{
CString strText;
for(int i = 0; i < stData.m_nNumData; i++)
{
strText.Format("数据:%f",stData.m_pMainData[i].m_fClose);
AfxMessageBox(strText);
}
}
}
代码已经修正