// MyFrame.cpp : implementation file
//
#include "stdafx.h"
#include "MyDllPj.h"
#include "MyFrame.h"
#include "MyDocument.h"
#include "MyView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMyFrame
IMPLEMENT_DYNCREATE(CMyFrame, CFrameWnd)
CMyFrame::CMyFrame()
{
}
CMyFrame::~CMyFrame()
{
}
BEGIN_MESSAGE_MAP(CMyFrame, CFrameWnd)
//{{AFX_MSG_MAP(CMyFrame)
ON_WM_CREATE()
ON_COMMAND(IDR_MYTEST,OnMenuDown)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
static UINT indicators[] =
{
ID_SEPARATOR, // status line indicator
ID_INDICATOR_CAPS,
ID_INDICATOR_NUM,
ID_INDICATOR_SCRL,
};
/////////////////////////////////////////////////////////////////////////////
// CMyFrame message handlers
BOOL CMyFrame::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Add your specialized code here and/or call the base class
return CFrameWnd::PreCreateWindow(cs);
}
int CMyFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
// TODO: Add your specialized creation code here
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);
// CCreateContext context;
// context.m_pNewViewClass = CRuntimeClass(CMyView);
// context.m_pCurrentDoc = new CMyDocument;
return 0;
}
void CMyFrame::OnMenuDown()
{
MessageBox("Yes");
}
- 1
- 2
前往页