本文整理汇总了C++中AfxGetProfile函数的典型用法代码示例。如果您正苦于以下问题:C++ AfxGetProfile函数的具体用法?C++ AfxGetProfile怎么用?C++ AfxGetProfile使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了AfxGetProfile函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AfxGetSListStockContainer
void CSListView::ResetColumns( )
{
CStockContainer & container = AfxGetSListStockContainer();
container.Lock();
// its list control through a call to GetListCtrl().
CSPDWordArray & auint = AfxGetProfile().GetSListColumnsShow( );
ASSERT( auint.GetSize() > 0 );
m_Grid.SetRedraw( FALSE );
m_Grid.DeleteAllItems();
m_Grid.SetRowCount(1);
m_Grid.SetFixedRowCount(1);
m_Grid.SetFixedColumnCount(1);
m_Grid.SetColumnCount(auint.GetSize());
for( int nCol=0; nCol<auint.GetSize(); nCol++ )
{
CString string = AfxGetVariantName(auint[nCol],TRUE);
m_Grid.SetItemText( 0, nCol, string );
m_Grid.SetItemData( 0, nCol, auint[nCol] );
m_Grid.SetItemFormat( 0, nCol, DT_CENTER|DT_VCENTER|DT_SINGLELINE );
m_Grid.SetItemBkColour( 0, nCol, AfxGetProfile().GetColor(CColorClass::clrSListBK) );
m_Grid.SetItemFgColour( 0, nCol, AfxGetProfile().GetColor(CColorClass::clrTitle) );
}
m_Grid.AutoSizeColumns();
m_Grid.SetRedraw( TRUE, TRUE );
m_Grid.Invalidate( );
container.UnLock();
}
示例2: UpdateStockContainerByKData
BOOL UpdateStockContainerByKData( CStockContainer &container, LPCTSTR lpszCode, CKData & kdata )
{
container.Lock();
int id = 0;
if( CKData::ktypeDay == kdata.GetKType()
&& container.GetStockInfo( lpszCode, NULL, &id ) )
{
CStockInfo & info = container.ElementAt(id);
if( kdata.GetSize() > (int)AfxGetProfile().GetCacheDays() )
{
// 只使用AfxGetProfile().GetCacheDays()天的数据
CKData temp( kdata.GetKType() );
for( int i=kdata.GetSize()-AfxGetProfile().GetCacheDays(); i<kdata.GetSize(); i++ )
temp.Add( kdata.ElementAt(i) );
info.m_kdata.MergeKData( &temp );
}
else
info.m_kdata.MergeKData( &kdata );
// 指数涨跌家数
int nSize = info.m_kdata.GetSize();
if( nSize > 0 )
{
info.m_dwAdvance = info.m_kdata.ElementAt(nSize-1).m_dwAdvance;
info.m_dwDecline = info.m_kdata.ElementAt(nSize-1).m_dwDecline;
}
}
container.UnLock();
return TRUE;
}
示例3: SetFocus
void CGraphView::OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint)
{
// TODO: Add your specialized code here and/or call the base class
if( UPDATE_HINT_GRAPHVIEW != lHint && UPDATE_HINT_GRAPHVIEW_NOTRELOADDATA != lHint )
return;
if( !IsWindowVisible() )
return;
SetFocus( );
CStockInfo info;
if( AfxGetProfile().GetCurrentStock( &info ) )
{
m_graph.SetCurStock( info );
m_graph.PrepareStockData( UPDATE_HINT_GRAPHVIEW_NOTRELOADDATA != lHint );
}
else
{
m_graph.SetCurStock( STKLIB_CODE_MAIN );
m_graph.PrepareStockData( UPDATE_HINT_GRAPHVIEW_NOTRELOADDATA != lHint );
AfxGetProfile().SetCurrentStock( STKLIB_CODE_MAIN, FALSE );
}
Invalidate( );
CMainFrame * pFrame = AfxGetMainFrame();
if( pFrame )
pFrame->m_SearchBox.SetCurrentWindowText( );
}
示例4: AfxInitializeDB
//////////////////////////////////////////////////////////////////////////////////
// database functions
BOOL AfxInitializeDB( LPSTR lpErr, UINT nMaxSize )
{
if( lpErr && nMaxSize > 0 )
memset( lpErr, 0, nMaxSize );
if( !CStDatabase::CreateSelfDB( AfxGetProfile().GetSelfDBPath() ) )
{
if( lpErr ) strncpy( lpErr, db_errcreateselfdb, min(nMaxSize-1,strlen(db_errcreateselfdb)) );
return FALSE;
}
if( !AfxGetDB().SetRootPath( AfxGetProfile().GetSelfDBPath(), IStStore::dbtypeSelfDB ) )
{
if( lpErr ) strncpy( lpErr, db_errrootpath, min(nMaxSize-1,strlen(db_errrootpath)) );
return FALSE;
}
CSPString strQianlongPath = AfxGetProfile().GetQianlongPath();
if( strQianlongPath.GetLength() > 0
&& !AfxGetDB().AddAssistantRootPath( strQianlongPath, IStStore::dbtypeQianlong ) )
{
if( lpErr ) strncpy( lpErr, db_errqianlongpath, min(nMaxSize-1,strlen(db_errqianlongpath)) );
return FALSE;
}
return TRUE;
}
示例5: SetFocus
void CRealTimeView::OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint)
{
// TODO: Add your specialized code here and/or call the base class
if( UPDATE_HINT_REALTIMEVIEW != lHint )
return;
if( !IsWindowVisible() )
return;
SetFocus( );
ASSERT( RTV_MAX_MULTICOUNT > 0 );
CStockInfo info;
if( AfxGetProfile().GetCurrentStock( &info ) )
{
m_realtime[0].SetCurStock( info );
m_realtime[0].PrepareStockData( );
}
else
{
m_realtime[0].SetCurStock( STKLIB_CODE_MAIN );
m_realtime[0].PrepareStockData( );
AfxGetProfile().SetCurrentStock( STKLIB_CODE_MAIN, FALSE );
}
if( CRealTime::modeReportDetail == m_realtime[0].GetDrawMode() )
AfxGetStkReceiver().RequestStockData( CStock::dataDetail, &info, 1, 0, 0 );
else
AfxGetStkReceiver().RequestStockData( CStock::dataMinute, &info, 1, 0, 0 );
// 多股同列
int i;
for( i=1; i<m_nMultiStockCount && i<RTV_MAX_MULTICOUNT; i++ )
{
if( AfxGetProfile().GetNextStock( &info ) )
{
m_realtime[i].SetCurStock( info );
m_realtime[i].PrepareStockData( );
if( CRealTime::modeReportDetail == m_realtime[0].GetDrawMode() )
AfxGetStkReceiver().RequestStockData( CStock::dataDetail, &info, 1, 0, 0 );
else
AfxGetStkReceiver().RequestStockData( CStock::dataMinute, &info, 1, 0, 0 );
}
}
for( i=1; i<m_nMultiStockCount && i<RTV_MAX_MULTICOUNT; i++ )
AfxGetProfile().GetPrevStock( &info );
Invalidate( );
if( 1 == m_nMultiStockCount && CRealTime::modePriceLine == m_realtime[0].GetDrawMode() )
m_wndReportTab.SetWindowPos( NULL, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW );
else
m_wndReportTab.SetWindowPos( NULL, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_HIDEWINDOW );
CMainFrame * pFrame = AfxGetMainFrame();
if( pFrame )
pFrame->m_SearchBox.SetCurrentWindowText( );
SendRequestQuote(TRUE);
}
示例6: AfxGetProfile
void CSetColumnDlg::OnSetdefault()
{
// TODO: Add your control notification handler code here
if( IDYES == AfxMessageBox( IDS_SETCOLUMN_SETDEFAULT, MB_YESNO | MB_ICONINFORMATION ) )
{
AfxGetProfile().SetSListColumnsDefault( );
SetListColumnItems( AfxGetProfile().GetSListColumnsShow(), TRUE );
}
}
示例7: AfxGetProfile
LRESULT CGraphView::OnColorChange(WPARAM wParam, LPARAM lParam)
{
m_wndReportTab.SetColorTabs(AfxGetProfile().GetColor(CColorClass::clrGraphBK));
m_wndReportTab.SetSelectTabColor( AfxGetProfile().GetColor(CColorClass::clrGraphBK),
AfxGetProfile().GetColor(CColorClass::clrTitle) );
Invalidate( );
return 0L;
}
示例8: AfxGetProfile
LRESULT CSListView::OnColorChange(WPARAM wParam, LPARAM lParam)
{
m_wndWorkTab.SetSelectTabColor( AfxGetProfile().GetColor(CColorClass::clrSListBK),
AfxGetProfile().GetColor(CColorClass::clrTitle) );
m_wndWorkTab.Invalidate( );
m_Grid.SetBkColor( AfxGetProfile().GetColor(CColorClass::clrSListBK) );
m_Grid.SetTextBkColor( AfxGetProfile().GetColor(CColorClass::clrSListBK) );
m_Grid.SetSelectedBkColor(AfxGetProfile().GetColor(CColorClass::clrSListSelected));
OnUpdate( NULL, UPDATE_HINT_SLISTVIEW, NULL );
return 0L;
}
示例9: UpdateData
void CSetColorDlg::OnCancel()
{
// TODO: Add extra cleanup here
UpdateData();
CColorClassContainer & container = AfxGetProfile().GetColorClassContainer( );
container.SetColorClass( m_clsOriginal );
CXFDialog::OnCancel();
AfxGetProfile().StoreProfile( );
OnColorChanged( );
}
示例10: AfxGetProfile
void CTyDataDlg::LoadProfile( )
{
m_strFileDest = AfxGetProfile().GetExportPath() + "Tysj.stk";
m_strPathSrcSH = AfxGetApp()->GetProfileString( "tydata", "pathsrcsh", m_strPathSrcSH );
m_strPathSrcSZ = AfxGetApp()->GetProfileString( "tydata", "pathsrcsz", m_strPathSrcSZ );
m_strFileDest = AfxGetApp()->GetProfileString( "tydata", "filedest", m_strFileDest );
if( (0 != access( m_strPathSrcSH, 0 ) || FILE_ATTRIBUTE_DIRECTORY != GetFileAttributes( m_strPathSrcSH ) ) )
m_strPathSrcSH = AfxGetProfile().GetWorkDirectory() + "data\\shase\\day\\";
if( (0 != access( m_strPathSrcSZ, 0 ) || FILE_ATTRIBUTE_DIRECTORY != GetFileAttributes( m_strPathSrcSZ ) ) )
m_strPathSrcSZ = AfxGetProfile().GetWorkDirectory() + "data\\sznse\\day\\";
}
示例11: SetFont
int CRealTimeView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CView::OnCreate(lpCreateStruct) == -1)
return -1;
CFont font;
if( !font.CreateStockObject( DEFAULT_GUI_FONT ) )
font.CreateStockObject( ANSI_VAR_FONT );
SetFont( &font );
// tab
if (!m_wndReportTab.Create(WS_VISIBLE|WS_CHILD,CRect(0,0,180,19),this,IDC_REALTIMEVIEW_REPORTTAB))
return -1;
CString strName;
strName.LoadString( IDS_REALTIMETAB_QUOTE );
m_wndReportTab.Addtab( this, strName, -1);
strName.LoadString( IDS_REALTIMETAB_PRICE );
m_wndReportTab.Addtab( this, strName, -1);
strName.LoadString( IDS_REALTIMETAB_MINUTE );
m_wndReportTab.Addtab( this, strName, -1);
strName.LoadString( IDS_REALTIMETAB_BUYSELLEX );
m_wndReportTab.Addtab( this, strName, -1);
strName.LoadString( IDS_REALTIMETAB_VALUE );
m_wndReportTab.Addtab( this, strName, -1);
strName.LoadString( IDS_REALTIMETAB_DISTRIBUTE );
m_wndReportTab.Addtab( this, strName, -1);
strName.LoadString( IDS_REALTIMETAB_BIGTRADE );
m_wndReportTab.Addtab( this, strName, -1);
m_wndReportTab.SetColorTabs(AfxGetProfile().GetColor(CColorClass::clrGraphBK));
m_wndReportTab.SetSelectTabColor( AfxGetProfile().GetColor(CColorClass::clrGraphBK),
AfxGetProfile().GetColor(CColorClass::clrTitle) );
m_wndReportTab.SetAutoAjust(FALSE);
m_wndReportTab.ShowButtonClose(FALSE);
m_wndReportTab.SetALingTabs( CGuiTabWnd::ALN_BOTTOM );
// m_realtime
for( int i=0; i<RTV_MAX_MULTICOUNT; i++ )
m_realtime[i].SetParent( this );
// 实时行情刷新
AfxGetStkReceiver().AddRcvDataWnd( GetSafeHwnd() );
// 大单成交刷新
SetTimer( RTV_TIMER_REFRESHBIGTRADE, 30000, NULL );
SetTimer( RTV_TIMER_REFRESH, 30000, NULL );
return 0;
}
示例12: AfxGetSView
BOOL CRegisterDlg::OnInitDialog()
{
CXFDialog::OnInitDialog();
m_linkGoPurchase.SetURL( (LPCTSTR)AfxGetProfile().GetPurchaseURL() );
BOOL bEnableApplyForEva = FALSE;
BOOL bEvaluate = AfxGetSView().IsEva();
if( bEvaluate )
{
CString strLeftDays;
if( AfxGetSView().GetLeft() > AfxGetSView().GetMaxEvaDays() )
strLeftDays.LoadString( IDS_REGISTER_NOTIMELIMIT );
else
strLeftDays.Format( "%d", AfxGetSView().GetLeft() );
m_staticLeftDays.SetWindowText( strLeftDays );
bEnableApplyForEva = (AfxGetSView().GetMaxEvaDays() <= 0);
}
else
{
CString strPurchased;
strPurchased.LoadString( IDS_REGISTER_PURCHASED );
m_staticLeftDaysTitle.SetWindowText( strPurchased );
m_staticLeftDays.SetWindowPos( NULL, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER|SWP_HIDEWINDOW );
m_linkGoPurchase.SetWindowPos( NULL, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER|SWP_HIDEWINDOW );
m_strUserName = AfxGetSView().GetU();
m_strRegCode = AfxGetSView().GetR();
}
m_strSoftNO = CSView::GetS();
UpdateData( FALSE );
m_btnApplyforEva.EnableWindow( bEnableApplyForEva );
CenterWindow();
CString strInfo;
if( bEvaluate && AfxGetSView().GetLeft() <= 0 )
{
strInfo.LoadString( IDS_EVALUATEINFO );
AfxMessageBox( strInfo, MB_OK | MB_ICONINFORMATION );
}
AfxGetSView().Store( AfxGetProfile().GetSViewFile() );
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
示例13: GetTreeCtrl
LRESULT CTechsView::OnColorChange(WPARAM wParam, LPARAM lParam)
{
CTreeCtrl &treectrl = GetTreeCtrl();
COLORREF clrBK = AfxGetProfile().GetColor( CColorClass::clrWorkspBK );
COLORREF clrText = AfxGetProfile().GetColor( CColorClass::clrWorkspText );
treectrl.SetBkColor( clrBK );
treectrl.SetTextColor( clrText );
CWnd * pParent = GetParent();
if( pParent && ::IsWindow(pParent->GetSafeHwnd()) )
pParent->SendMessage( WM_GUITABWND_COLORCHANGE, clrBK, clrText );
Invalidate( );
return 0;
}
示例14: AfxGetProfile
void CSetColorDlg::OnSelchangeColorclass()
{
// TODO: Add your control notification handler code here
CColorClassContainer & container = AfxGetProfile().GetColorClassContainer( );
if( m_strNameCurrent.GetLength() > 0 )
{
CColorClass cls;
cls.SetColorDefault();
cls.SetName( m_strNameCurrent );
StoreToColorClass( cls );
VERIFY( container.SetColorClass( cls ) );
}
CString strNameNow;
m_comboColorClass.GetWindowText( strNameNow );
CColorClass clsNow;
if( container.GetColorClass( strNameNow, clsNow ) )
{
LoadFromColorClass( clsNow );
m_clsOriginal = clsNow;
m_strNameCurrent = strNameNow;
m_btnDelete.EnableWindow( !CColorClass::IsSysColorClass( strNameNow ) );
}
}
示例15: SetListColumnItems
BOOL CSetColumnDlg::OnInitDialog()
{
CXFDialog::OnInitDialog();
// TODO: Add extra initialization here
m_listColumn.SendMessage( LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_CHECKBOXES | LVS_EX_FULLROWSELECT | LVS_EX_HEADERDRAGDROP
| LVS_EX_FLATSB | LVS_EX_REGIONAL | LVS_EX_INFOTIP | LVS_EX_UNDERLINEHOT );
CRect rectList;
m_listColumn.GetClientRect( &rectList );
CString strHeaderName, strHeaderDescript, strHeaderSetting, strUserDefine;
strHeaderName.LoadString( IDS_SETCOLUMN_NAME );
strHeaderDescript.LoadString( IDS_SETCOLUMN_DESCRIPT );
strHeaderSetting.LoadString( IDS_SETCOLUMN_SETTING );
strUserDefine.LoadString( IDS_SETCOLUMN_USERDEFINE );
m_listColumn.InsertColumn( 0, strHeaderName, LVCFMT_CENTER, rectList.Width() / 3 - 8 );
m_listColumn.InsertColumn( 1, strHeaderDescript, LVCFMT_CENTER, rectList.Width() / 3 - 2 );
m_listColumn.InsertColumn( 2, strHeaderSetting, LVCFMT_CENTER, rectList.Width() / 3 - 8 );
SetListColumnItems( AfxGetProfile().GetSListColumnsShow(), FALSE );
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}