동연총결산04-대화상자01
// Dialog2View.cpp : implementation of the CDialog2View class
//
#include "stdafx.h"
#include "Dialog2.h"
#include "Dialog2Doc.h"
#include "Dialog2View.h"
#include "MyDialog.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDialog2View
IMPLEMENT_DYNCREATE(CDialog2View, CView)
BEGIN_MESSAGE_MAP(CDialog2View, CView)
//{{AFX_MSG_MAP(CDialog2View)
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()
/////////////////////////////////////////////////////////////////////////////
// CDialog2View construction/destruction
CDialog2View::CDialog2View()
{
// TODO: add construction code here
}
CDialog2View::~CDialog2View()
{
}
BOOL CDialog2View::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CDialog2View drawing
void CDialog2View::OnDraw(CDC* pDC)
{
CDialog2Doc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
pDC->TextOut(20, 20, strName);
}
/////////////////////////////////////////////////////////////////////////////
// CDialog2View printing
BOOL CDialog2View::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CDialog2View::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CDialog2View::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
/////////////////////////////////////////////////////////////////////////////
// CDialog2View diagnostics
#ifdef _DEBUG
void CDialog2View::AssertValid() const
{
CView::AssertValid();
}
void CDialog2View::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
CDialog2Doc* CDialog2View::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CDialog2Doc)));
return (CDialog2Doc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CDialog2View message handlers
void CDialog2View::OnMenuitem32771()
{
// TODO: Add your command handler code here
MyDialog my;
my.DoModal();
if (my.DoModal() == IDOK)
{
// MessageBox(my.m_strName);
strName = my.m_strName;
Invalidate();
}
}
control을 사용할 때, 연결 컨트롤 형식은 MyDialog 클래스에서만 사용할 수 있으며, 중간 변수strID를 추가합니다.
// Dialog2View.cpp : implementation of the CDialog2View class
//
#include "stdafx.h"
#include "Dialog2.h"
#include "Dialog2Doc.h"
#include "Dialog2View.h"
#include "MyDialog.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDialog2View
IMPLEMENT_DYNCREATE(CDialog2View, CView)
BEGIN_MESSAGE_MAP(CDialog2View, CView)
//{{AFX_MSG_MAP(CDialog2View)
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()
/////////////////////////////////////////////////////////////////////////////
// CDialog2View construction/destruction
CDialog2View::CDialog2View()
{
// TODO: add construction code here
}
CDialog2View::~CDialog2View()
{
}
BOOL CDialog2View::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CDialog2View drawing
void CDialog2View::OnDraw(CDC* pDC)
{
CDialog2Doc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
pDC->TextOut(20, 20, strName);
}
/////////////////////////////////////////////////////////////////////////////
// CDialog2View printing
BOOL CDialog2View::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CDialog2View::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CDialog2View::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
/////////////////////////////////////////////////////////////////////////////
// CDialog2View diagnostics
#ifdef _DEBUG
void CDialog2View::AssertValid() const
{
CView::AssertValid();
}
void CDialog2View::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
CDialog2Doc* CDialog2View::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CDialog2Doc)));
return (CDialog2Doc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CDialog2View message handlers
void CDialog2View::OnMenuitem32771()
{
// TODO: Add your command handler code here
MyDialog my;
my.DoModal();
// if (my.DoModal() == IDOK)
{
// MessageBox(my.m_strName);
strName = my.m_strName + " " + my.strID;
Invalidate();
}
}
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
다양한 언어의 JSONJSON은 Javascript 표기법을 사용하여 데이터 구조를 레이아웃하는 데이터 형식입니다. 그러나 Javascript가 코드에서 이러한 구조를 나타낼 수 있는 유일한 언어는 아닙니다. 저는 일반적으로 '객체'{}...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.