本文整理汇总了C++中CStockInfo::GetStockCode方法的典型用法代码示例。如果您正苦于以下问题:C++ CStockInfo::GetStockCode方法的具体用法?C++ CStockInfo::GetStockCode怎么用?C++ CStockInfo::GetStockCode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CStockInfo
的用法示例。
在下文中一共展示了CStockInfo::GetStockCode方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetVariantSaveValue
BOOL CStockContainer::GetVariantSaveValue( double *pValue, UINT nVariantID, CStockInfo &info, BOOL *pNoValue )
{
CSPMutex::Scoped l(m_mutex);
void * pArrayID = NULL;
if( !m_map.Lookup( info.GetStockCode(), pArrayID ) )
return FALSE;
int nIndex = (int)pArrayID;
if( nIndex >= 0 && nIndex < m_aptrSaveValueArray.GetSize() )
{
CSPPtrArray * pArray = (CSPPtrArray *)m_aptrSaveValueArray.ElementAt( nIndex );
if( pArray )
{
VARIANT_SAVEVALUE * pSave = NULL;
for( int j=0; j<pArray->GetSize(); j++ )
{
pSave = (VARIANT_SAVEVALUE *) pArray->GetAt(j);
if( pSave->nVariantID == nVariantID )
{
if( pValue ) *pValue = pSave->Value;
if( pNoValue ) *pNoValue = pSave->bNoValue;
return TRUE;
}
}
}
}
return FALSE;
}
示例2: Add
int CStockContainer::Add( CStockInfo &newElement )
{
CSPMutex::Scoped l(m_mutex);
int nIndex = CStockInfoArray::Add(newElement);
m_map.SetAt( newElement.GetStockCode(), (void *)nIndex );
return nIndex;
}
示例3: SetCurrentWindowText
void CSearchBox::SetCurrentWindowText( )
{
if( !::IsWindow(m_hWnd) )
return;
if( !m_bShowOnSel )
return;
CStockInfo info;
if( AfxGetProfile().GetCurrentStock( &info ) )
{
if( CB_ERR == SelectString( 0, info.GetStockCode() ) )
SetWindowText( info.GetStockCode() );
}
else
{
SetWindowText( NULL );
}
}
示例4: SetVariantSaveValue
void CStockContainer::SetVariantSaveValue( double Value, UINT nVariantID, CStockInfo &info, BOOL bNoValue )
{
CSPMutex::Scoped l(m_mutex);
void * pArrayID = NULL;
if( !m_map.Lookup( info.GetStockCode(), pArrayID ) )
return;
// alloc for m_aptrSaveValueArray
if( m_aptrSaveValueArray.GetSize() == 0 )
{
m_aptrSaveValueArray.SetSize( GetSize() );
for( int i=0; i<m_aptrSaveValueArray.GetSize(); i++ )
m_aptrSaveValueArray.SetAt( i, NULL );
}
int nIndex = (int)pArrayID;
if( nIndex >= 0 && nIndex < m_aptrSaveValueArray.GetSize() )
{
CSPPtrArray * pArray = (CSPPtrArray *)m_aptrSaveValueArray.ElementAt( nIndex );
if( NULL == pArray )
{
pArray = new CSPPtrArray;
m_aptrSaveValueArray.SetAt( nIndex, pArray );
}
// 如果已经存在,覆盖之
for( int j=0; j<pArray->GetSize(); j++ )
{
VARIANT_SAVEVALUE * pSave = (VARIANT_SAVEVALUE *) pArray->GetAt(j);
if( pSave->nVariantID == nVariantID )
{
pSave->Value = Value;
pSave->bNoValue = bNoValue;
return;
}
}
// 加入新的
VARIANT_SAVEVALUE * pSaveValue = new VARIANT_SAVEVALUE;
pSaveValue->nVariantID = nVariantID;
pSaveValue->Value = Value;
pSaveValue->bNoValue = bNoValue;
pArray->Add( pSaveValue );
}
}
示例5: OnUpdate
void CBaseView::OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint)
{
// TODO: Add your specialized code here and/or call the base class
if( UPDATE_HINT_BASEVIEW != lHint )
return;
if( IsWindowVisible() )
SetFocus( );
CStockInfo info;
if( !AfxGetProfile().GetCurrentStock( &info ) )
return;
CString strHeader = info.GetStockCode();
strHeader += " ";
strHeader += info.GetStockName();
strHeader += "\r\n\r\n ";
GetEditCtrl().SetWindowText( strHeader );
GetEditCtrl().SetSel( strHeader.GetLength()-1, strHeader.GetLength()-1 );
m_stock.Clear( );
m_stock.SetStockInfo( &info );
m_stock.SetDatabase( &AfxGetDB() );
m_stock.PrepareBaseInfo( TRUE );
char * pText = m_stock.GetBaseTextPtr();
int nLength = m_stock.GetBaseTextLength();
if( pText && nLength > 0 )
{
GetEditCtrl().ReplaceSel( pText );
}
else
{
CString strNoBaseData;
strNoBaseData.LoadString( IDS_BASEVIEW_NOBASEDATA );
GetEditCtrl().ReplaceSel( strNoBaseData );
}
GetEditCtrl().SetSel( 0, 0 );
AfxGetStkReceiver().RequestStockData( CStock::dataBasetext, &info, 1, 0, 0 );
}
示例6: AfxReloadStock
BOOL AfxReloadStock( CStock & stock )
{
CStockInfo info = stock.GetStockInfo();
// Reload AfxGetStockMain()
AfxGetStockContainer().GetStockInfo( info.GetStockCode(), &info );
stock.Clear( );
stock.SetStockInfo( &info );
stock.SetDatabase( &AfxGetDB() );
stock.PrepareData( CStock::dataK, CKData::ktypeDay );
// Merge New
stock.GetKDataDay().MergeKData( &(info.m_kdata) );
stock.PrepareData( CStock::dataK, CKData::ktypeWeek );
stock.PrepareData( CStock::dataK, CKData::ktypeMonth );
stock.PrepareData( CStock::dataK, CKData::ktypeMin5 );
stock.PrepareData( CStock::dataK, CKData::ktypeMin15 );
stock.PrepareData( CStock::dataK, CKData::ktypeMin30 );
stock.PrepareData( CStock::dataK, CKData::ktypeMin60 );
return TRUE;
}
示例7: InitStocks
BOOL CSearchBox::InitStocks( CSPStringArray & astocks, BOOL bHasSTTTech, BOOL bShowOnSel, BOOL bDuplicate )
{
ResetContent( );
m_bShowOnSel = bShowOnSel;
CStockContainer & container = AfxGetStockContainer();
InitStorage( bDuplicate ? astocks.GetSize()*2 : astocks.GetSize(), 32 );
for( int i=0; i<astocks.GetSize(); i++ )
{
if( astocks.ElementAt(i).GetLength() <= 0 )
continue;
CStockInfo info;
int nAID = -1;
if( !container.GetStockInfo( astocks.ElementAt(i), &info, &nAID ) )
continue;
CString strTemp = info.GetStockCode();
while( strTemp.GetLength() < 8 )
strTemp += ' ';
strTemp += info.GetStockName();
int nItem = AddString( strTemp );
SetItemData( nItem, nAID );
if( bDuplicate )
{
strTemp = info.GetStockShortName();
while( strTemp.GetLength() < 8 )
strTemp += ' ';
strTemp += info.GetStockName();
if( CB_ERR == SelectString( 0, strTemp ) )
{
nItem = AddString( strTemp );
SetItemData( nItem, nAID );
}
}
}
if( bHasSTTTech )
{
// 技术指标项
UINT nTechUserCount = CTechUser::GetTechUserCount();
for( UINT i=STT_MIN; i <= STT_MAX+nTechUserCount; i ++ )
{
UINT nTech = i;
if( nTech > STT_MAX )
nTech = i-STT_MAX-1+STT_USER_MIN;
CString strTemp = AfxGetSTTShortName( nTech );
while( strTemp.GetLength() < 8 )
strTemp += ' ';
strTemp += AfxGetSTTName( nTech );
int nItem = AddString( strTemp );
SetItemData( nItem, nTech | SEARCHBOX_SIGNBIT_STT );
}
// 快捷键项
for( UINT i = ACCE_MIN; i <= ACCE_MAX; i++ )
{
CString strTemp = AfxGetAccelerator( i, 8 );
SetItemData( AddString(strTemp), i | SEARCHBOX_SIGNBIT_ACCE );
}
}
return TRUE;
}