本文整理汇总了C++中RUNTIME_CLASS函数的典型用法代码示例。如果您正苦于以下问题:C++ RUNTIME_CLASS函数的具体用法?C++ RUNTIME_CLASS怎么用?C++ RUNTIME_CLASS使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了RUNTIME_CLASS函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sizeof
BOOL CSceneEditorApp::InitInstance()
{
// InitCommonControlsEx() is required on Windows XP if an application
// manifest specifies use of ComCtl32.dll version 6 or later to enable
// visual styles. Otherwise, any window creation will fail.
INITCOMMONCONTROLSEX InitCtrls;
InitCtrls.dwSize = sizeof(InitCtrls);
// Set this to include all the common control classes you want to use
// in your application.
InitCtrls.dwICC = ICC_WIN95_CLASSES;
InitCommonControlsEx(&InitCtrls);
CWinApp::InitInstance();
// Initialize OLE libraries
if (!AfxOleInit())
{
AfxMessageBox(IDP_OLE_INIT_FAILED);
return FALSE;
}
AfxEnableControlContainer();
EnableTaskbarInteraction(FALSE);
// AfxInitRichEdit2() is required to use RichEdit control
// AfxInitRichEdit2();
// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need
// Change the registry key under which our settings are stored
// TODO: You should modify this string to be something appropriate
// such as the name of your company or organization
SetRegistryKey(_T("AJN\\Disaster Simulator\\SceneEditor Application"));
LoadStdProfileSettings(4); // Load standard INI file options (including MRU)
// Register the application's document templates. Document templates
// serve as the connection between documents, frame windows and views
CSingleDocTemplate* pDocTemplate;
pDocTemplate = new CSingleDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CSceneEditorDoc),
RUNTIME_CLASS(CMainFrame), // main SDI frame window
RUNTIME_CLASS(CSceneEditorView));
if (!pDocTemplate)
return FALSE;
AddDocTemplate(pDocTemplate);
// Parse command line for standard shell commands, DDE, file open
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
// Enable DDE Execute open
EnableShellOpen();
RegisterShellFileTypes(TRUE);
// Dispatch commands specified on the command line. Will return FALSE if
// app was launched with /RegServer, /Register, /Unregserver or /Unregister.
if (!ProcessShellCommand(cmdInfo))
return FALSE;
// The one and only window has been initialized, so show and update it
m_pMainWnd->ShowWindow(SW_SHOW);
m_pMainWnd->UpdateWindow();
// call DragAcceptFiles only if there's a suffix
// In an SDI app, this should occur after ProcessShellCommand
// Enable drag/drop open
m_pMainWnd->DragAcceptFiles();
InitEngine();
return TRUE;
}
示例2: RUNTIME_CLASS
#include "BCGPDockBar.h"
#include "BCGPDockingControlBar.h"
#include "BCGPDockBarRow.h"
#include "trackmouse.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
#define BCGP_DISPLAY_AHWND_EVENT 1
int CBCGPAutoHideToolBar::m_nShowAHWndDelay = 400;
CRuntimeClass* CBCGPAutoHideToolBar::m_pAutoHideButtonRTS = RUNTIME_CLASS (CBCGPAutoHideButton);
IMPLEMENT_DYNCREATE(CBCGPAutoHideToolBar, CBCGPControlBar)
/////////////////////////////////////////////////////////////////////////////
// CBCGPAutoHideToolBar
CBCGPAutoHideToolBar::CBCGPAutoHideToolBar()
{
m_pLastActiveButton = NULL;
m_bReadyToDisplayAHWnd = FALSE;
m_nDisplayAHWndTimerID = 0;
m_pHighlightedButton = NULL;
m_bTracked = FALSE;
m_bResetSizes = FALSE;
}
示例3: AfxMessageBox
//.........这里部分代码省略.........
InitCommonControlsEx(&InitCtrls);
#ifdef _DEBUG //Just some test code to exercise the various methods which implement Vincenty's algorithms
COSMCtrlPosition pos1(-77.04978, 38.88922);
double dEndBearing = 0;
COSMCtrlPosition pos2 = COSMCtrlHelper::GetPosition(pos1, 51.7679, 6179016.13586, &dEndBearing);
double dStartBearing;
double dDistance = COSMCtrlHelper::DistanceBetweenPoints(pos1, pos2, &dStartBearing, &dEndBearing);
dDistance;
//Do the reverse test
COSMCtrlPosition pos3(2.29583, 48.85889);
double dStartBearing2;
double dEndBearing2;
double dDistance2 = COSMCtrlHelper::DistanceBetweenPoints(pos1, pos3, &dStartBearing2, &dEndBearing2);
pos1 = COSMCtrlPosition(175.04978, 38.88922);
pos2 = COSMCtrlHelper::GetPosition(pos1, 90, 8000, &dEndBearing);
pos1 = COSMCtrlPosition(-77.04978, 38.88922);
double dEndBearing3;
COSMCtrlPosition pos4 = COSMCtrlHelper::GetPosition(pos1, dStartBearing2, dDistance2, &dEndBearing3);
COSMCtrlPosition pos5(-180, 0);
COSMCtrlPosition pos6(0, 0);
double dStartBearing5;
double dEndBearing5;
double dDistance5 = COSMCtrlHelper::DistanceBetweenPoints(pos5, pos6, &dStartBearing5, &dEndBearing5);
dDistance5;
COSMCtrlPosition pos7(0, 0);
COSMCtrlPosition pos8(-180, 0);
double dStartBearing7;
double dEndBearing7;
double dDistance7 = COSMCtrlHelper::DistanceBetweenPoints(pos7, pos8, &dStartBearing7, &dEndBearing7);
dDistance7;
COSMCtrlPosition pos9(0, 90);
COSMCtrlPosition pos10(0, -90);
double dStartBearing9;
double dEndBearing9;
double dDistance9 = COSMCtrlHelper::DistanceBetweenPoints(pos9, pos10, &dStartBearing9, &dEndBearing9);
dDistance9;
COSMCtrlPosition pos11(0, -90);
COSMCtrlPosition pos12(0, 90);
double dStartBearing11;
double dEndBearing11;
double dDistance11 = COSMCtrlHelper::DistanceBetweenPoints(pos11, pos12, &dStartBearing11, &dEndBearing11);
dDistance11;
COSMCtrlPosition pos13(0, 60);
COSMCtrlPosition pos14(180, -60);
double dStartBearing13;
double dEndBearing13;
double dDistance13 = COSMCtrlHelper::DistanceBetweenPoints(pos13, pos14, &dStartBearing13, &dEndBearing13);
dDistance13;
COSMCtrlPosition pos15(180, -60);
COSMCtrlPosition pos16(0, 60);
double dStartBearing15;
double dEndBearing15;
double dDistance15 = COSMCtrlHelper::DistanceBetweenPoints(pos15, pos16, &dStartBearing15, &dEndBearing15);
dDistance15;
#endif
CWinApp::InitInstance();
//Standard initialization
SetRegistryKey(_T("Local AppWizard-Generated Applications"));
LoadStdProfileSettings(4); // Load standard INI file options (including MRU)
//Register the application's document templates. Document templates
//serve as the connection between documents, frame windows and views
CSingleDocTemplate* pDocTemplate;
pDocTemplate = new CSingleDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(COSMCtrlAppDoc),
RUNTIME_CLASS(CMainFrame), // main SDI frame window
RUNTIME_CLASS(COSMCtrlAppView));
if (!pDocTemplate)
return FALSE;
AddDocTemplate(pDocTemplate);
//Parse command line for standard shell commands, DDE, file open
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
//Dispatch commands specified on the command line. Will return FALSE if
//app was launched with /RegServer, /Register, /Unregserver or /Unregister.
if (!ProcessShellCommand(cmdInfo))
return FALSE;
//The one and only window has been initialized, so show and update it
m_pMainWnd->ShowWindow(SW_SHOW);
m_pMainWnd->UpdateWindow();
return TRUE;
}
示例4: RUNTIME_CLASS
void CRetrConfigDlg::UpdateGrid(void)
{
CString str;
CStringArray aOptions;
CWordArray aProcesses;
for(int j = 0; j < m_Main_Set.m_ProcessInfoArray.GetSize();j++)
{
if(m_Main_Set.m_ProcessInfoArray[j].TYPE_PROTOKOL == 2)
{
str.Format("№%d (MODBUS-slave)",j+1);
aProcesses.Add(j+1);
aOptions.Add(str);
}
if(m_Main_Set.m_ProcessInfoArray[j].TYPE_PROTOKOL == 4)
{
str.Format("№%d (IEC870-5-101-slave)",j+1);
aOptions.Add(str);
aProcesses.Add(j+1);
}
if(m_Main_Set.m_ProcessInfoArray[j].TYPE_PROTOKOL == 8)
{
str.Format("№%d (IEC870-5-104-slave PtP)",j+1);
aOptions.Add(str);
aProcesses.Add(j+1);
}
if(m_Main_Set.m_ProcessInfoArray[j].TYPE_PROTOKOL == 14)
{
str.Format("№%d (IEC870-5-104-slave PtMP)",j+1);
aOptions.Add(str);
aProcesses.Add(j+1);
}
if(m_Main_Set.m_ProcessInfoArray[j].TYPE_PROTOKOL == 18)
{
str.Format("№%d (Вывод на ДЩ)",j+1);
aOptions.Add(str);
aProcesses.Add(j+1);
}
}
m_Grid.DeleteNonFixedRows();
for(int i = 0; i < m_Retr.m_ManyRetrArray.GetSize();i++)
{
int nIndex = m_Grid.InsertRow(NULL);
str.Format("%d",i+1);
m_Grid.SetItemText(nIndex,0,str);
str.Format("%d",m_Retr.m_ManyRetrArray[i].START_ADRES_OBJECT);
m_Grid.SetItemText(nIndex,1,str);
str.Format("%d",m_Retr.m_ManyRetrArray[i].START_ADRES_RETR);
m_Grid.SetItemText(nIndex,2,str);
str.Format("%d",m_Retr.m_ManyRetrArray[i].NUM_MANY_RETR_OBJECT);
m_Grid.SetItemText(nIndex,3,str);
m_Grid.SetCellType(nIndex,4, RUNTIME_CLASS(CGridCellCombo));
CGridCellCombo *pCell = (CGridCellCombo*) m_Grid.GetCell(nIndex,4);
pCell->SetOptions(aOptions);
pCell->SetStyle(CBS_DROPDOWNLIST); //CBS_DROPDOWN, CBS_DROPDOWNLIST, CBS_SIMPLE
for(int k = 0; k < aProcesses.GetSize(); k++)
{
if(aProcesses[k] == m_Retr.m_ManyRetrArray[i].PATH_DIRECT)
{
pCell->SetCurSel(k);
break;
}
}
m_Grid.SetItemText(nIndex,5,m_Retr.m_ManyRetrArray[i].strCOMMENT);
}
m_Grid.AutoSize();
m_Grid.Refresh();
}
示例5: ASSERT
CH3Doc* CH3View::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CH3Doc)));
return (CH3Doc*)m_pDocument;
}
示例6: sizeof
BOOL CExpressSystemApp::InitInstance()
{
// 如果一个运行在 Windows XP 上的应用程序清单指定要
// 使用 ComCtl32.dll 版本 6 或更高版本来启用可视化方式,
//则需要 InitCommonControlsEx()。 否则,将无法创建窗口。
INITCOMMONCONTROLSEX InitCtrls;
InitCtrls.dwSize = sizeof(InitCtrls);
// 将它设置为包括所有要在应用程序中使用的
// 公共控件类。
InitCtrls.dwICC = ICC_WIN95_CLASSES;
InitCommonControlsEx(&InitCtrls);
CWinApp::InitInstance();
AfxEnableControlContainer();
// 创建 shell 管理器,以防对话框包含
// 任何 shell 树视图控件或 shell 列表视图控件。
CShellManager *pShellManager = new CShellManager;
// 激活“Windows Native”视觉管理器,以便在 MFC 控件中启用主题
CMFCVisualManager::SetDefaultManager(RUNTIME_CLASS(CMFCVisualManagerWindows));
// 标准初始化
// 如果未使用这些功能并希望减小
// 最终可执行文件的大小,则应移除下列
// 不需要的特定初始化例程
// 更改用于存储设置的注册表项
// TODO: 应适当修改该字符串,
// 例如修改为公司或组织名
SetRegistryKey(_T("快递系统"));
DatabaseADO::initADO(); // enable ADO
DatabaseADO baseAdo;
DatabaseADO outAdo;
if (outAdo.openBase(FileNameString) == false)
{
outAdo.CreateMdb(FileNameString);
}
CExpressSystemDlg dlg(baseAdo, outAdo);
m_pMainWnd = &dlg;
INT_PTR nResponse = dlg.DoModal();
if (nResponse == IDOK)
{
// TODO: 在此放置处理何时用
// “确定”来关闭对话框的代码
}
else if (nResponse == IDCANCEL)
{
// TODO: 在此放置处理何时用
// “取消”来关闭对话框的代码
}
else if (nResponse == -1)
{
TRACE(traceAppMsg, 0, "警告: 对话框创建失败,应用程序将意外终止。\n");
TRACE(traceAppMsg, 0, "警告: 如果您在对话框上使用 MFC 控件,则无法 #define _AFX_NO_MFC_CONTROLS_IN_DIALOGS。\n");
}
// 删除上面创建的 shell 管理器。
if (pShellManager != NULL)
{
delete pShellManager;
}
// 由于对话框已关闭,所以将返回 FALSE 以便退出应用程序,
// 而不是启动应用程序的消息泵。
return FALSE;
}
示例7: tree
/*****************************************************************************
Sets up a column to be drawn with + - tree controls w/ indenting. Text
is automatically indented. Rows expand and collapse as appropriate
3/2001: Tree can be in fixed column, too
*****************************************************************************/
BOOL CTreeColumn::TreeSetup( CGridCtrl* apGridCtrl, // tree acts on a column in this grid
int aiColumn, // which column has tree
int aiTotalRows, // total number of rows in the
// tree if totally expanded
int aiFixedRowCount,// Set fixed row count now, too
// Grid total rows=aiTotalRows+aiFixedRowCount
const unsigned char* apucTreeLevelAry, // Tree Level data array --
// must have aiTotalRows of entries
BOOL abShowTreeLines, // T=show tree (not grid) lines; F=no tree lines
BOOL abUseImages, // T=use 1st 3 images from already set image list
// to display folder graphics
CRuntimeClass* apRuntimeClass) // can use your special
// CGridTreeCellBase-derived class
// returns: success / fail
{
ASSERT( apGridCtrl != NULL);
ASSERT( aiColumn < apGridCtrl->GetColumnCount());
m_pRuntimeClassTreeCell = apRuntimeClass;
if( m_pRuntimeClassTreeCell == NULL) // default can hold data
m_pRuntimeClassTreeCell = RUNTIME_CLASS(CGridTreeCell);
if (!m_pRuntimeClassTreeCell->IsDerivedFrom(RUNTIME_CLASS(CGridTreeCellBase)))
{
ASSERT( FALSE);
return FALSE;
}
m_pGrid = apGridCtrl;
m_bAllowDraw = FALSE; // prevents crash during reset
BOOL bRC = TRUE;
m_iFixedRowCount = aiFixedRowCount;
m_iRowCount = aiTotalRows + aiFixedRowCount;
m_iColumnWithTree = aiColumn;
m_pGrid->SetFixedRowCount( m_iFixedRowCount);
m_pGrid->SetRowCount( m_iRowCount);
if( aiTotalRows > 0)
{
ASSERT( apucTreeLevelAry != NULL);
// retain old cell properties: establishes size for
// tree drawing box based on current font
CGridTreeCell GridCellCopy;
GridCellCopy.SetTreeColumn( this);
CGridCellBase* pCurrCell = m_pGrid->GetCell( 0, m_iColumnWithTree);
if (pCurrCell)
GridCellCopy = *pCurrCell;
// copy all data while replacing cells to tree cell type
for( int i1=0; i1 < aiTotalRows; i1++)
{
int iCellRow = m_iFixedRowCount + i1;
if( !m_pGrid->SetCellType( iCellRow,
m_iColumnWithTree,
m_pRuntimeClassTreeCell ) )
{
bRC = FALSE;
break;
}
CGridTreeCell* pGridTreeCell = (CGridTreeCell*)m_pGrid->GetCell( iCellRow, m_iColumnWithTree);
if( pGridTreeCell != NULL)
{
pGridTreeCell->SetTreeColumn( this);
pGridTreeCell->SetLevelAndHide( *apucTreeLevelAry );
}
apucTreeLevelAry++;
}
SetTreeUsesImages( abUseImages); // T=use images
SetTreeLines( abShowTreeLines); // T=show tree lines
}
m_bAllowDraw = TRUE;
m_pGrid->Invalidate();
return bRC;
}
示例8: test_duplicate
//.........这里部分代码省略.........
producerConsumerTest();
excel_column_converter(std::string("AA"));
excel_column_converter(std::string("27"));
// other method for odd even printing ... doesn't work...
// {
//InitializeCriticalSection(&cs);
//_beginthreadex(NULL, NULL, even_thread_cs, 0,0, 0);
//_beginthreadex(NULL, NULL, odd_thread_cs, 0,0, 0);
//getchar();
//}
return TRUE;
// InitCommonControlsEx() is required on Windows XP if an application
// manifest specifies use of ComCtl32.dll version 6 or later to enable
// visual styles. Otherwise, any window creation will fail.
INITCOMMONCONTROLSEX InitCtrls;
InitCtrls.dwSize = sizeof(InitCtrls);
// Set this to include all the common control classes you want to use
// in your application.
InitCtrls.dwICC = ICC_WIN95_CLASSES;
InitCommonControlsEx(&InitCtrls);
CWinAppEx::InitInstance();
// Initialize OLE libraries
if (!AfxOleInit())
{
AfxMessageBox(IDP_OLE_INIT_FAILED);
return FALSE;
}
AfxEnableControlContainer();
EnableTaskbarInteraction(FALSE);
// AfxInitRichEdit2() is required to use RichEdit control
// AfxInitRichEdit2();
// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need
// Change the registry key under which our settings are stored
// TODO: You should modify this string to be something appropriate
// such as the name of your company or organization
SetRegistryKey(_T("Local AppWizard-Generated Applications"));
LoadStdProfileSettings(4); // Load standard INI file options (including MRU)
InitContextMenuManager();
InitKeyboardManager();
InitTooltipManager();
CMFCToolTipInfo ttParams;
ttParams.m_bVislManagerTheme = TRUE;
theApp.GetTooltipManager()->SetTooltipParams(AFX_TOOLTIP_TYPE_ALL,
RUNTIME_CLASS(CMFCToolTipCtrl), &ttParams);
// Register the application's document templates. Document templates
// serve as the connection between documents, frame windows and views
CSingleDocTemplate* pDocTemplate;
pDocTemplate = new CSingleDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CMultiDoc),
RUNTIME_CLASS(CMainFrame), // main SDI frame window
RUNTIME_CLASS(CMultiView));
if (!pDocTemplate)
return FALSE;
AddDocTemplate(pDocTemplate);
// Parse command line for standard shell commands, DDE, file open
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
// Dispatch commands specified on the command line. Will return FALSE if
// app was launched with /RegServer, /Register, /Unregserver or /Unregister.
if (!ProcessShellCommand(cmdInfo))
return FALSE;
// The one and only window has been initialized, so show and update it
m_pMainWnd->ShowWindow(SW_SHOW);
m_pMainWnd->UpdateWindow();
// call DragAcceptFiles only if there's a suffix
// In an SDI app, this should occur after ProcessShellCommand
return TRUE;
}
示例9: ASSERT
BOOL COXCustomizeTabbedMDIPage::ApplyChanges()
{
if(!UpdateData(TRUE))
return FALSE;
CWnd* pWnd=AfxGetMainWnd();
ASSERT(pWnd!=NULL && ::IsWindow(pWnd->GetSafeHwnd()));
ASSERT_KINDOF(CMDIFrameWnd,pWnd);
if(!pWnd->IsKindOf(RUNTIME_CLASS(CMDIFrameWnd)))
{
TRACE(_T("COXCustomizeTabbedMDIPage::InitializeTabbedMDI: tabbed MDI is supported only for MDI applications\n"));
return FALSE;
}
m_dwStyle=0;
// orientation
switch(m_treeTabCtrlSettings.GetCheckedRadioButton(IDC_RADIO_ORIENT_LEFT,
IDC_RADIO_ORIENT_BOTTOM))
{
case IDC_RADIO_ORIENT_LEFT:
m_dwStyle|=TCS_VERTICAL;
break;
case IDC_RADIO_ORIENT_TOP:
break;
case IDC_RADIO_ORIENT_RIGHT:
m_dwStyle|=TCS_VERTICAL|TCS_BOTTOM;
break;
case IDC_RADIO_ORIENT_BOTTOM:
m_dwStyle|=TCS_BOTTOM;
break;
default:
ASSERT(FALSE);
}
// appearance
switch(m_treeTabCtrlSettings.GetCheckedRadioButton(IDC_RADIO_APPEARANCE_TAB_BUTTONS,
IDC_RADIO_APPEARANCE_FLAT_BUTTONS))
{
case IDC_RADIO_APPEARANCE_TAB_BUTTONS:
break;
case IDC_RADIO_APPEARANCE_PUSH_BUTTONS:
m_dwStyle|=TCS_BUTTONS;
break;
case IDC_RADIO_APPEARANCE_FLAT_BUTTONS:
m_dwStyle|=TCS_BUTTONS|TCS_FLATBUTTONS;
break;
default:
ASSERT(FALSE);
}
// positioning
switch(m_treeTabCtrlSettings.GetCheckedRadioButton(IDC_RADIO_POSITIONING_SINGLELINE,
IDC_RADIO_POSITIONING_MULTILINE))
{
case IDC_RADIO_POSITIONING_SINGLELINE:
break;
case IDC_RADIO_POSITIONING_MULTILINE:
m_dwStyle|=TCS_MULTILINE;
break;
default:
ASSERT(FALSE);
}
// display
if(m_treeTabCtrlSettings.GetCheck(IDC_CHECK_DISPLAY_HOTTRACK)==OTITEM_CHECKED)
m_dwStyle|=TCS_HOTTRACK;
if(m_treeTabCtrlSettings.GetCheck(IDC_CHECK_DISPLAY_FIXEDWIDTH)==OTITEM_CHECKED)
m_dwStyle|=TCS_FIXEDWIDTH;
if(m_treeTabCtrlSettings.GetCheck(IDC_CHECK_DISPLAY_NORAGGEDRIGHT)==OTITEM_UNCHECKED)
m_dwStyle|=TCS_RAGGEDRIGHT;
if(m_treeTabCtrlSettings.GetCheck(IDC_CHECK_DISPLAY_SCROLLOPPOSITE)==OTITEM_CHECKED)
m_dwStyle|=TCS_SCROLLOPPOSITE;
if(m_treeTabCtrlSettings.GetCheck(IDC_CHECK_DISPLAY_FORCEICONLEFT)==OTITEM_CHECKED)
m_dwStyle|=TCS_FORCEICONLEFT;
if(m_treeTabCtrlSettings.GetCheck(IDC_CHECK_DISPLAY_FORCELABELLEFT)==OTITEM_CHECKED)
m_dwStyle|=TCS_FORCELABELLEFT;
//
/////////////////////////////////
if ( m_MTIClientWnd.m_hWnd != NULL )
{
if(m_bSupportTabbedMDI==m_MTIClientWnd.IsAttached() &&
m_dwOffset==m_MTIClientWnd.GetTabCtrl()->GetOffset() &&
m_dwStyle==(m_MTIClientWnd.GetTabCtrl()->GetStyle()&0x0fff))
{
return TRUE;
}
if(m_MTIClientWnd.IsAttached())
{
// check if it has been attached to background painter before
#ifdef OX_CUSTOMIZE_BACKGROUND
BOOL bPaintBackground=FALSE;
COXBackgroundPainterOrganizer* pBackgroundOrganizer=
m_pCustomizeManager->GetBackgroundPainterOrganizer();
ASSERT(pBackgroundOrganizer!=NULL);
COXDIB dib;
PaintType paintType=Tile;
//.........这里部分代码省略.........
示例10: AfxGetApp
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
AfxGetApp()->m_nCmdShow = SW_HIDE;
if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
//界面居中显示
this ->CenterWindow(CWnd::GetDesktopWindow());
if (!m_wndStatusBar.Create(this) ||
!m_wndStatusBar.SetIndicators(indicators,
sizeof(indicators)/sizeof(UINT)))
{
TRACE0("Failed to create status bar\n");
return -1; // fail to create
}
m_wndStatusBar.SetPaneInfo(0, m_wndStatusBar.GetItemID(0), SBPS_STRETCH, NULL);
m_wndStatusBar.SetPaneInfo(1, m_wndStatusBar.GetItemID(1), SBPS_NORMAL, 180);
m_wndStatusBar.SetPaneInfo(2, m_wndStatusBar.GetItemID(2), SBPS_NORMAL, 100);
m_wndStatusBar.SetPaneInfo(3, m_wndStatusBar.GetItemID(3), SBPS_NORMAL, 100);
m_wndStatusBar.SetPaneInfo(4, m_wndStatusBar.GetItemID(4), SBPS_NORMAL, NULL);
m_wndStatusBar.SetPaneInfo(5, m_wndStatusBar.GetItemID(5), SBPS_NORMAL, NULL);
m_wndStatusBar.SetPaneInfo(6, m_wndStatusBar.GetItemID(6), SBPS_NORMAL, NULL);
///////////////////////////////////////////////////////////////////////////////////////
m_wndStatusBar.EnableCustomization();
if (!m_TrayIcon.Create(_T(""), // Toolktip text
this, // Parent window
IDR_MAINFRAME, // Icon resource ID
IDR_MINIMIZE, // Resource ID of popup menu
IDM_SHOW, // Default menu item for popup menu
false)) // True if default menu item is located by position
{
TRACE0("Failed to create tray icon\n");
return -1;
}
if (!InitCommandBars())
{
return -1;
}
CXTPCommandBars* pCommandBars = GetCommandBars();
CXTPCommandBar* pMenuBar = pCommandBars->SetMenu(_T("Menu Bar"), IDR_MAINFRAME);
pMenuBar->SetFlags(xtpFlagAddMDISysPopup);
CXTPToolBar* pCommandBar = (CXTPToolBar*)pCommandBars->Add(_T("Standard"), xtpBarTop);
if (!pCommandBar ||
!pCommandBar->LoadToolBar(IDR_TOOLBAR3))
{
TRACE0("Failed to create toolbar\n");
return -1;
};
pCommandBars->GetCommandBarsOptions()->bShowTextBelowIcons = TRUE;
pCommandBars->GetCommandBarsOptions()->ShowKeyboardCues(xtpKeyboardCuesShowWindowsDefault);
m_paneManager.InstallDockingPanes(this);
m_paneManager.SetTheme(xtpPaneThemeWinExplorer);
CXTPDockingPane* pwndPaneLog = CreatePane(300, 141, RUNTIME_CLASS(CLogView), _T("日志信息"), xtpPaneDockBottom);
CXTPDockingPane* pwndPaneShortcuts = CreatePane(200, 145, RUNTIME_CLASS(CShortcuts), _T("快捷功能"), xtpPaneDockRight,pwndPaneLog);
CXTPDockingPane* pwndPaneIPUP = CreatePane(200, 145, RUNTIME_CLASS(CIPUpdate), _T("域名更新"), xtpPaneDockRight,pwndPaneLog);
pwndPaneIPUP->Select();
m_paneManager.AttachPane( pwndPaneIPUP ,pwndPaneShortcuts );
pwndPaneShortcuts->SetOptions(xtpPaneNoCaption);
pwndPaneIPUP->SetOptions(xtpPaneNoCaption);
XTPColorManager()->DisableLunaColors(TRUE);
CXTPPaintManager::SetTheme(xtpThemeOffice2003);
LoadCommandBars(_T("CommandBars"));
SetTimer(1,1000,NULL);
return 0;
}
示例11: sizeof
BOOL CmouseApp::InitInstance()
{
// アプリケーション マニフェストが visual スタイルを有効にするために、
// ComCtl32.dll Version 6 以降の使用を指定する場合は、
// Windows XP に InitCommonControlsEx() が必要です。さもなければ、ウィンドウ作成はすべて失敗します。
INITCOMMONCONTROLSEX InitCtrls;
InitCtrls.dwSize = sizeof(InitCtrls);
// アプリケーションで使用するすべてのコモン コントロール クラスを含めるには、
// これを設定します。
InitCtrls.dwICC = ICC_WIN95_CLASSES;
InitCommonControlsEx(&InitCtrls);
CWinApp::InitInstance();
// OLE ライブラリを初期化します。
if (!AfxOleInit())
{
AfxMessageBox(IDP_OLE_INIT_FAILED);
return FALSE;
}
AfxEnableControlContainer();
EnableTaskbarInteraction(FALSE);
// RichEdit コントロールを使用するには AfxInitRichEdit2() が必要です
// AfxInitRichEdit2();
// 標準初期化
// これらの機能を使わずに最終的な実行可能ファイルの
// サイズを縮小したい場合は、以下から不要な初期化
// ルーチンを削除してください。
// 設定が格納されているレジストリ キーを変更します。
// TODO: 会社名または組織名などの適切な文字列に
// この文字列を変更してください。
SetRegistryKey(_T("アプリケーション ウィザードで生成されたローカル アプリケーション"));
LoadStdProfileSettings(4); // 標準の INI ファイルのオプションをロードします (MRU を含む)
// アプリケーション用のドキュメント テンプレートを登録します。ドキュメント テンプレート
// はドキュメント、フレーム ウィンドウとビューを結合するために機能します。
CSingleDocTemplate* pDocTemplate;
pDocTemplate = new CSingleDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CmouseDoc),
RUNTIME_CLASS(CMainFrame), // メイン SDI フレーム ウィンドウ
RUNTIME_CLASS(CmouseView));
if (!pDocTemplate)
return FALSE;
AddDocTemplate(pDocTemplate);
// DDE、file open など標準のシェル コマンドのコマンド ラインを解析します。
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
// コマンド ラインで指定されたディスパッチ コマンドです。アプリケーションが
// /RegServer、/Register、/Unregserver または /Unregister で起動された場合、False を返します。
if (!ProcessShellCommand(cmdInfo))
return FALSE;
// メイン ウィンドウが初期化されたので、表示と更新を行います。
m_pMainWnd->ShowWindow(SW_SHOW);
m_pMainWnd->UpdateWindow();
return TRUE;
}
示例12: ASSERT
Cmfc_opencv_demoDoc* Cmfc_opencv_demoView::GetDocument() const // 非调试版本是内联的
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(Cmfc_opencv_demoDoc)));
return (Cmfc_opencv_demoDoc*)m_pDocument;
}
示例13: ASSERT
CSoCProjectDoc* CSoCProjectView::GetDocument() const // 디버그되지 않은 버전은 인라인으로 지정됩니다.
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CSoCProjectDoc)));
return (CSoCProjectDoc*)m_pDocument;
}
示例14: ASSERT
BOOL CSizingControlBar::NegotiateSpace(int nLengthTotal, BOOL bHorz)
{
ASSERT(bHorz == IsHorzDocked());
int nFirst, nLast, nThis;
GetRowInfo(nFirst, nLast, nThis);
int nLengthAvail = nLengthTotal;
int nLengthActual = 0;
int nLengthMin = 2;
int nWidthMax = 0;
CSizingControlBar* pBar;
int i;
for (i = nFirst; i <= nLast; i++)
{
pBar = (CSizingControlBar*) m_pDockBar->m_arrBars[i];
if (HIWORD(pBar) == 0) continue; // placeholder
if (!pBar->IsVisible()) continue;
BOOL bIsSizingBar =
pBar->IsKindOf(RUNTIME_CLASS(CSizingControlBar));
int nLengthBar; // minimum length of the bar
if (bIsSizingBar)
nLengthBar = bHorz ? pBar->m_szMinHorz.cx - 2 :
pBar->m_szMinVert.cy - 2;
else
{
CRect rcBar;
pBar->GetWindowRect(&rcBar);
nLengthBar = bHorz ? rcBar.Width() - 2 : rcBar.Height() - 2;
}
nLengthMin += nLengthBar;
if (nLengthMin > nLengthTotal)
{
// split the row after fixed bar
if (i < nThis)
{
m_pDockBar->m_arrBars.InsertAt(i + 1,
(CControlBar*) NULL);
return FALSE;
}
// only this sizebar remains on the row, adjust it to minsize
if (i == nThis)
{
if (bHorz)
m_szHorz.cx = m_szMinHorz.cx;
else
m_szVert.cy = m_szMinVert.cy;
return TRUE; // the dockbar will split the row for us
}
// we have enough bars - go negotiate with them
m_pDockBar->m_arrBars.InsertAt(i, (CControlBar*) NULL);
nLast = i - 1;
break;
}
if (bIsSizingBar)
{
nLengthActual += bHorz ? pBar->m_szHorz.cx - 2 :
pBar->m_szVert.cy - 2;
nWidthMax = max(nWidthMax, bHorz ? pBar->m_szHorz.cy :
pBar->m_szVert.cx);
}
else
nLengthAvail -= nLengthBar;
}
CSCBArray arrSCBars;
GetRowSizingBars(arrSCBars);
int nNumBars = arrSCBars.GetSize();
int nDelta = nLengthAvail - nLengthActual;
// return faster when there is only one sizing bar per row (this one)
if (nNumBars == 1)
{
ASSERT(arrSCBars[0] == this);
if (nDelta == 0)
return TRUE;
m_bKeepSize = FALSE;
(bHorz ? m_szHorz.cx : m_szVert.cy) += nDelta;
return TRUE;
}
// make all the bars the same width
for (i = 0; i < nNumBars; i++)
if (bHorz)
arrSCBars[i]->m_szHorz.cy = nWidthMax;
else
arrSCBars[i]->m_szVert.cx = nWidthMax;
// distribute the difference between the bars,
// but don't shrink them below their minsizes
//.........这里部分代码省略.........
示例15: ASSERT
CMabinogiPackageToolDoc* CLeftView::GetDocument() // 非调试版本是内联的
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CMabinogiPackageToolDoc)));
return (CMabinogiPackageToolDoc*)m_pDocument;
}