在视图中弹出一个对话框

1.在DIalog中插入一个新的对话框;

2.在菜单中添加新的工能;

3.在视图中添加头文件;

// wenbenkuangView.cpp : implementation of the CWenbenkuangView class
//

#include "stdafx.h"
#include "wenbenkuang.h"
#include "MyDialog.h"
#include "wenbenkuangDoc.h"
#include "wenbenkuangView.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/
// CWenbenkuangView

IMPLEMENT_DYNCREATE(CWenbenkuangView, CView)

BEGIN_MESSAGE_MAP(CWenbenkuangView, CView)
	//{{AFX_MSG_MAP(CWenbenkuangView)
	ON_COMMAND(ID_MENUITEM32771, OnMenuitem32771)
	//}}AFX_MSG_MAP
	// Standard printing commands
	ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
END_MESSAGE_MAP()

/
// CWenbenkuangView construction/destruction

CWenbenkuangView::CWenbenkuangView()
{
	// TODO: add construction code here

}

CWenbenkuangView::~CWenbenkuangView()
{
}

BOOL CWenbenkuangView::PreCreateWindow(CREATESTRUCT& cs)
{
	// TODO: Modify the Window class or styles here by modifying
	//  the CREATESTRUCT cs

	return CView::PreCreateWindow(cs);
}

/
// CWenbenkuangView drawing

void CWenbenkuangView::OnDraw(CDC* pDC)
{
	CWenbenkuangDoc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);
//	pDC->TextOut();
	// TODO: add draw code for native data here
}

/
// CWenbenkuangView printing

BOOL CWenbenkuangView::OnPreparePrinting(CPrintInfo* pInfo)
{
	// default preparation
	return DoPreparePrinting(pInfo);
}

void CWenbenkuangView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
	// TODO: add extra initialization before printing
}

void CWenbenkuangView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
	// TODO: add cleanup after printing
}

/
// CWenbenkuangView diagnostics

#ifdef _DEBUG
void CWenbenkuangView::AssertValid() const
{
	CView::AssertValid();
}

void CWenbenkuangView::Dump(CDumpContext& dc) const
{
	CView::Dump(dc);
}

CWenbenkuangDoc* CWenbenkuangView::GetDocument() // non-debug version is inline
{
	ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CWenbenkuangDoc)));
	return (CWenbenkuangDoc*)m_pDocument;
}
#endif //_DEBUG

/
// CWenbenkuangView message handlers

void CWenbenkuangView::OnMenuitem32771() 
{     MyDialog my;
      my.DoModal();
      Invalidate();
	// TODO: Add your command handler code here
	
}


 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值