// MainFrm.cpp : implementation of the CMainFrame class
//
#include "stdafx.h"
#include "Bayes.h"
#include "MainFrm.h"
#include "PaneCtrl.h"
#include "PaneDataBrowse.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMainFrame
IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd)
BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
//{{AFX_MSG_MAP(CMainFrame)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code !
ON_WM_CREATE()
//}}AFX_MSG_MAP
ON_COMMAND_EX(CG_ID_VIEW_WORKSPACE, OnBarCheck)
ON_UPDATE_COMMAND_UI(CG_ID_VIEW_WORKSPACE, OnUpdateControlBarMenu)
END_MESSAGE_MAP()
static UINT indicators[] =
{
ID_SEPARATOR, // status line indicator
ID_INDICATOR_CAPS,
ID_INDICATOR_NUM,
ID_INDICATOR_SCRL,
};
/////////////////////////////////////////////////////////////////////////////
// CMainFrame construction/destruction
CMainFrame::CMainFrame()
{
// TODO: add member initialization code here
}
CMainFrame::~CMainFrame()
{
}
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
!m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
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
}
// TODO: Delete these three lines if you don't want the toolbar to
// be dockable
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_wndToolBar);
InitWorkShop();
return 0;
}
int CMainFrame::InitWorkShop()
{
m_ImageList.Create(IDB_IMAGELIST, 13, 1, RGB(0,255,0));
// CG: The following block was inserted by the 'Dialog Bar' component
{
m_wndWorkspace.SetBtnImageList (&m_ImageList);
// m_wndWorkspace.SetMenuID(IDR_POPUP);
// Initialize dialog bar m_wndWorkspace
if (!m_wndWorkspace.Create(this, CG_ID_VIEW_WORKSPACE,
_T("Workspace"), CSize(330,200)))
{
TRACE0("Failed to create dialog bar m_wndWorkspace\n");
return -1; // fail to create
}
// Add the views to the tab control.
m_wndWorkspace.AddView(_T("控制面板"), RUNTIME_CLASS(CPaneCtrl));
m_wndWorkspace.AddView(_T("数据浏览"), RUNTIME_CLASS(CPaneDataBrowse));
// Define the image list to use with the tab control
m_TabImages.Create (IDB_IL_TAB, 16, 1, RGB(0,255,0));
m_wndWorkspace.SetTabImageList(&m_TabImages);
// allow bar to be resized when floating
m_wndWorkspace.SetBarStyle(m_wndWorkspace.GetBarStyle() |
CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
m_wndWorkspace.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_wndWorkspace, AFX_IDW_DOCKBAR_RIGHT);
}
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
if( !CFrameWnd::PreCreateWindow(cs) )
return FALSE;
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
// CMainFrame diagnostics
#ifdef _DEBUG
void CMainFrame::AssertValid() const
{
CFrameWnd::AssertValid();
}
void CMainFrame::Dump(CDumpContext& dc) const
{
CFrameWnd::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CMainFrame message handlers
Compiling...
MainFrm.cpp
Linking...
MainFrm.obj : error LNK2001: unresolved external symbol "public: static struct CRuntimeClass const CPaneDataBrowse::classCPaneDataBrowse" (?classCPaneDataBrowse@CPaneDataBrowse@@2UCRuntimeClass@@B)
MainFrm.obj : error LNK2001: unresolved external symbol "public: static struct CRuntimeClass const CPaneCtrl::classCPaneCtrl" (?classCPaneCtrl@CPaneCtrl@@2UCRuntimeClass@@B)
Debug/Bayes.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.
Creating browse info file...
Bayes.exe - 3 error(s), 0 warning(s)