//---------------------------------------------------------------------------- // EgalTech 2013-2014 //---------------------------------------------------------------------------- // File : TestEGrView.cpp Data : 05.02.14 Versione : 1.5b3 // Contenuto : Implementazione della classe gestione vista OpenGL. // // // // Modifiche : 29.01.14 DS Creazione modulo. // // //---------------------------------------------------------------------------- //--------------------------- Include ---------------------------------------- #include "stdafx.h" #include "TestEgrView.h" #include "resource.h" //---------------------------------------------------------------------------- #ifdef _DEBUG #define new DEBUG_NEW #endif //---------------------------------------------------------------------------- BEGIN_MESSAGE_MAP( TestEgrView, CWnd) ON_WM_CREATE() END_MESSAGE_MAP() //---------------------------------------------------------------------------- TestEgrView::TestEgrView( void) { m_pDC = nullptr ; } //---------------------------------------------------------------------------- TestEgrView::~TestEgrView( void) { if ( m_pDC != nullptr) delete m_pDC ; m_pDC = nullptr ; } //---------------------------------------------------------------------------- bool TestEgrView::Create( CWnd* pParent, int nID) { if ( pParent == nullptr || pParent->GetDlgItem( nID) == nullptr) return false ; CString className = AfxRegisterWndClass( CS_HREDRAW | CS_VREDRAW | CS_OWNDC, AfxGetApp()->LoadCursor( IDC_POINTER), (HBRUSH)GetStockObject(WHITE_BRUSH), NULL) ; CRect rectWin ; pParent->GetDlgItem( nID)->GetWindowRect( rectWin) ; pParent->ScreenToClient( rectWin) ; if ( CreateEx( 0, className, L"TestEgrView", WS_VISIBLE | WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, rectWin, pParent, nID) != 0) { SetWindowPos( &wndTop, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE) ; return true ; } else return false ; } //---------------------------------------------------------------------------- int TestEgrView::OnCreate( LPCREATESTRUCT lpCreateStruct) { if ( CWnd::OnCreate( lpCreateStruct) == -1) return -1 ; m_pDC = new CClientDC( this) ; if ( m_pDC == nullptr) return -1 ; return 0 ; }