PlaqueDemo.cpp 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. // PlaqueDEMO.cpp : implementation for the PlaqueDemo application
  2. #include "stdafx.h"
  3. #include "PlaqueDemo.h"
  4. #include "MainFrm.h"
  5. // CPlaqueDemoApp
  6. BEGIN_MESSAGE_MAP(CPlaqueDemoApp, CWinApp)
  7. END_MESSAGE_MAP()
  8. // CPlaqueDemoApp constructor
  9. CPlaqueDemoApp::CPlaqueDemoApp()
  10. : m_Mutex( FALSE, _T( "PlaqueDemoApp" ) ), m_block( FALSE )
  11. {
  12. }
  13. CPlaqueDemoApp::~CPlaqueDemoApp()
  14. {
  15. if ( m_block )
  16. m_Mutex.Unlock();
  17. }
  18. // The only CPlaqueDemoApp object instance
  19. CPlaqueDemoApp theApp;
  20. // Initialization of CPlaqueDemoApp
  21. BOOL CPlaqueDemoApp::InitInstance()
  22. {
  23. if ( !( m_block = m_Mutex.Lock( 0 ) ) )
  24. return FALSE;
  25. InitCommonControls();
  26. CWinApp::InitInstance();
  27. // Create main window
  28. RECT m_winArea;
  29. m_winArea.left = 20;
  30. m_winArea.top = 20;
  31. m_winArea.right = 788;
  32. m_winArea.bottom = 596;
  33. CMainFrame* pFrame = new CMainFrame;
  34. pFrame->SetRect( m_winArea );
  35. pFrame->LoadFrame(IDR_MAINFRAME, WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE, NULL, NULL);
  36. if ( !pFrame->GetSafeHwnd() )
  37. {
  38. return FALSE;
  39. }
  40. m_pMainWnd = pFrame;
  41. CCommandLineInfo cmdInfo;
  42. ParseCommandLine(cmdInfo);
  43. if (!ProcessShellCommand(cmdInfo))
  44. return FALSE;
  45. m_pMainWnd->MoveWindow( &m_winArea );
  46. m_pMainWnd->SetWindowText(_T( "Plaque Library Demo Beta 1.0.0" ));
  47. m_pMainWnd->UpdateWindow();
  48. m_penDraw.CreatePen(PS_SOLID, 1, RGB (255, 255, 0));
  49. m_penVert.CreatePen(PS_SOLID, 2, RGB (0, 255, 0));
  50. m_penBleu.CreatePen(PS_SOLID, 2, RGB (0, 0, 255));
  51. m_penRouge.CreatePen(PS_SOLID, 2, RGB (255, 0, 0));
  52. return TRUE;
  53. }