本文整理汇总了C++中CExpression::SetParamVar方法的典型用法代码示例。如果您正苦于以下问题:C++ CExpression::SetParamVar方法的具体用法?C++ CExpression::SetParamVar怎么用?C++ CExpression::SetParamVar使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CExpression
的用法示例。
在下文中一共展示了CExpression::SetParamVar方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnOK
//.........这里部分代码省略.........
{
::MessageBox( m_hWnd,_T(" 请正确填写几次达标后触发! "),_T(" 提示 "), MB_OK);
m_wndTrigerNum.SetFocus();
return ;
}
gap = atoi(csGap);
if( gap < -1 || gap > SHORT_MAX)//
{
::MessageBox( m_hWnd,_T(" 请正确填写连续委托间隔! "),_T(" 提示 "), MB_OK);
m_wndGap.SetFocus();
return ;
}
m_pStrategy->m_nPeriodType = perType;
m_pStrategy->m_nPeriodNumber = perNum;
m_pStrategy->m_nMaxBuyTimes = buyTimes;
m_pStrategy->m_nMaxSellTimes = sellTimes;
m_pStrategy->m_nTrigTimes = trigTime;
m_pStrategy->m_nMaxTrigTimes = trigNum;
m_pStrategy->m_nGap = gap;
if(m_pStrategy->m_nGap == 0)//默认为30秒
{
m_pStrategy->m_nGap = 30;
}
if (m_wndCheck.GetCheck())
{
m_pStrategy->m_bFuQuan = 0;
}
else
{
m_pStrategy->m_bFuQuan = 1;
}
if (m_wndXD.GetCheck())
{
m_pStrategy->m_bXD = 1;
}
else
{
m_pStrategy->m_bXD = 0;
}
if (m_pStrategy->m_pData == NULL)
{
m_pStrategy->m_pData = new CLineProperty;
}
if (!m_pStrategy->m_pData->m_pCurVal)
{
m_pStrategy->m_pData->m_pCurVal = new CExpValue;
}
//只保存公式名和变量
CExpression *pNew;
if (!((CExpValue*)(m_pStrategy->m_pData->m_pCurVal))->GetExp())
{
pNew = new CExpression;
}
else
pNew = ((CExpValue*)(m_pStrategy->m_pData->m_pCurVal))->GetExp();
CExpression *pTreeExp = pTreeGroup->GetData();
if (pTreeExp)//复制参数值
{
CMapVariabile *pMv = pTreeExp->GetParamVar();
//----------------------------------------------
if (pMv)
{
CMapVariabile *pMap = new CMapVariabile;
CString key;
CValue *cvalue;
POSITION pos;
pos = pMv->GetStartPosition();
while(pos)
{
pMv->GetNextAssoc(pos,key,cvalue);
CNumericValue *pnum = new CNumericValue;
double db = cvalue->GetValue();
pnum->SetValue(db);
pnum->SetStyle(cvalue->GetStyle());
pnum->SetMaxValue(((CNumericValue*)cvalue)->GetMaxValue());
pnum->SetMinValue(((CNumericValue*)cvalue)->GetMinValue());
pnum->SetTestStepValue(((CNumericValue*)cvalue)->GetTestStepValue());
pnum->SetDescribe(((CNumericValue*)cvalue)->GetDescribe());
pMap->SetAt(key,pnum);
}
//===============================================================
pNew->SetParamVar(pMap);//存储变量值
}
memcpy(m_pStrategy->m_sExpName,pTreeExp->GetName(),32);//存储公式名
}
((CExpValue*)(m_pStrategy->m_pData->m_pCurVal))->SetValue(pNew);
}
CWnd* pwnd = GetParent();
if (pwnd && pwnd->IsKindOf(RUNTIME_CLASS(CDlgStrategyMain)))
{
CDlgStrategyMain *pMain = (CDlgStrategyMain*)pwnd;
pMain->m_bHQOK = TRUE;
}
OnCancel();
return ;
_Exit:
::MessageBox( m_hWnd,_T(" 请选择一个公式! "),_T(" 提示 "), MB_OK);
return ;
}