CMake/Tests/MFC/mfc1/mfc1View.cpp
David Cole 36b0c432cf Tests: Add the MFC test (#11213)
Build a simple, do-nothing VS 7.1 MFC wizard generated app
with CMake.

Build it two different ways via ExternalProject, one with
CMAKE_MFC_FLAG set to 1 for linking to MFC statically, and
one with CMAKE_MFC_FLAG set to 2 for linking to the shared
MFC dlls.

Validate that the install tree of the static build has only
one *.exe file in it and nothing else. Also validate that the
install tree of the shared library build has multiple files in
it (no less than 3) and that they are only of the expected types
*.exe, *.dll and *.manifest.

This commit does not address the issue reported in #11213,
it merely adds a test that may be used to show that the
bug report is valid. After this commit, the MFC test should
fail on any dashboard machines that have MSVC defined, but
cannot build an MFC app. We can then analyze that failure
data as input to solving the issue.
2011-11-01 10:08:58 -04:00

100 lines
1.7 KiB
C++

// mfc1View.cpp : implementation of the Cmfc1View class
//
#include "stdafx.h"
#include "mfc1.h"
#include "mfc1Doc.h"
#include "mfc1View.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
// Cmfc1View
IMPLEMENT_DYNCREATE(Cmfc1View, CView)
BEGIN_MESSAGE_MAP(Cmfc1View, CView)
// 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()
// Cmfc1View construction/destruction
Cmfc1View::Cmfc1View()
{
// TODO: add construction code here
}
Cmfc1View::~Cmfc1View()
{
}
BOOL Cmfc1View::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CView::PreCreateWindow(cs);
}
// Cmfc1View drawing
void Cmfc1View::OnDraw(CDC* /*pDC*/)
{
Cmfc1Doc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
if (!pDoc)
return;
// TODO: add draw code for native data here
}
// Cmfc1View printing
BOOL Cmfc1View::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void Cmfc1View::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void Cmfc1View::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
// Cmfc1View diagnostics
#ifdef _DEBUG
void Cmfc1View::AssertValid() const
{
CView::AssertValid();
}
void Cmfc1View::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
Cmfc1Doc* Cmfc1View::GetDocument() const // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(Cmfc1Doc)));
return (Cmfc1Doc*)m_pDocument;
}
#endif //_DEBUG
// Cmfc1View message handlers