// PlaqueDEMO.cpp : implementation for the PlaqueDemo application #include "stdafx.h" #include "PlaqueDemo.h" #include "MainFrm.h" // CPlaqueDemoApp BEGIN_MESSAGE_MAP(CPlaqueDemoApp, CWinApp) END_MESSAGE_MAP() // CPlaqueDemoApp constructor CPlaqueDemoApp::CPlaqueDemoApp() : m_Mutex( FALSE, _T( "PlaqueDemoApp" ) ), m_block( FALSE ) { } CPlaqueDemoApp::~CPlaqueDemoApp() { if ( m_block ) m_Mutex.Unlock(); } // The only CPlaqueDemoApp object instance CPlaqueDemoApp theApp; // Initialization of CPlaqueDemoApp BOOL CPlaqueDemoApp::InitInstance() { if ( !( m_block = m_Mutex.Lock( 0 ) ) ) return FALSE; InitCommonControls(); CWinApp::InitInstance(); // Create main window RECT m_winArea; m_winArea.left = 20; m_winArea.top = 20; m_winArea.right = 788; m_winArea.bottom = 596; CMainFrame* pFrame = new CMainFrame; pFrame->SetRect( m_winArea ); pFrame->LoadFrame(IDR_MAINFRAME, WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE, NULL, NULL); if ( !pFrame->GetSafeHwnd() ) { return FALSE; } m_pMainWnd = pFrame; CCommandLineInfo cmdInfo; ParseCommandLine(cmdInfo); if (!ProcessShellCommand(cmdInfo)) return FALSE; m_pMainWnd->MoveWindow( &m_winArea ); m_pMainWnd->SetWindowText(_T( "Plaque Library Demo Beta 1.0.0" )); m_pMainWnd->UpdateWindow(); m_penDraw.CreatePen(PS_SOLID, 1, RGB (255, 255, 0)); m_penVert.CreatePen(PS_SOLID, 2, RGB (0, 255, 0)); m_penBleu.CreatePen(PS_SOLID, 2, RGB (0, 0, 255)); m_penRouge.CreatePen(PS_SOLID, 2, RGB (255, 0, 0)); return TRUE; }