home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c480 / 19.ddi / MFC / SAMPLES / VBCIRCLE / VBCIRCLE.CP_ / VBCIRCLE.CP
Encoding:
Text File  |  1993-02-08  |  2.5 KB  |  92 lines

  1. // vbcircle.cpp : Defines the class behaviors for the application.
  2. //
  3. // This is a part of the Microsoft Foundation Classes C++ library.
  4. // Copyright (C) 1992 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. // This source code is only intended as a supplement to the
  8. // Microsoft Foundation Classes Reference and Microsoft
  9. // QuickHelp and/or WinHelp documentation provided with the library.
  10. // See these sources for detailed information regarding the
  11. // Microsoft Foundation Classes product.
  12.  
  13.  
  14. #include "stdafx.h"
  15. #include "vbcircle.h"
  16.  
  17. #include "frame.h"
  18.  
  19. #ifdef _DEBUG
  20. #undef THIS_FILE
  21. static char BASED_CODE THIS_FILE[] = __FILE__;
  22. #endif
  23.  
  24. /////////////////////////////////////////////////////////////////////////////
  25. // CVbcircleApp
  26.  
  27. BEGIN_MESSAGE_MAP(CVBCircleApp, CWinApp)
  28.     //{{AFX_MSG_MAP(CVBCircleApp)
  29.     ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
  30.     //}}AFX_MSG_MAP
  31. END_MESSAGE_MAP()
  32.  
  33. /////////////////////////////////////////////////////////////////////////////
  34. // CVBCircleApp construction
  35. // Place all significant initialization in InitInstance
  36.  
  37. CVBCircleApp::CVBCircleApp()
  38. {
  39. }
  40.  
  41. /////////////////////////////////////////////////////////////////////////////
  42. // The one and only CVBCircleApp object
  43.  
  44. CVBCircleApp NEAR theApp;
  45.  
  46. /////////////////////////////////////////////////////////////////////////////
  47. // CVBCircleApp initialization
  48.  
  49. BOOL CVBCircleApp::InitInstance()
  50. {
  51.     SetDialogBkColor();        // set dialog background color
  52.     EnableVBX();               // Initialize VBX support
  53.  
  54.     // Check to see that the VBX control is present
  55.     if (LoadVBXFile("Circ3.vbx") > HINSTANCE_ERROR)
  56.         UnloadVBXFile("Circ3.vbx");
  57.     else
  58.     {
  59.         AfxMessageBox("Cannot Load Circ3.VBX\nPlace the file on the path",
  60.                         MB_OK | MB_ICONEXCLAMATION);
  61.         return FALSE;
  62.     }
  63.  
  64.  
  65.  
  66.     CFrameWnd* pMainFrame = new CVBCircleFrame;
  67.     if (!pMainFrame->LoadFrame(IDR_MAINFRAME))
  68.         return FALSE;
  69.     pMainFrame->ShowWindow(m_nCmdShow);
  70.     pMainFrame->UpdateWindow();
  71.     m_pMainWnd = pMainFrame;
  72.  
  73.     return TRUE;
  74. }
  75.  
  76. /////////////////////////////////////////////////////////////////////////////
  77.  
  78. void CVBCircleApp::OnAppAbout()
  79. {
  80.     CDialog(IDD_ABOUTBOX).DoModal();
  81. }
  82.  
  83. /////////////////////////////////////////////////////////////////////////////
  84.  
  85. //{{AFX_VBX_REGISTER_MAP()
  86.     UINT NEAR VBN_CLICKIN = AfxRegisterVBEvent("CLICKIN");
  87.     UINT NEAR VBN_CLICKOUT = AfxRegisterVBEvent("CLICKOUT");
  88. //}}AFX_VBX_REGISTER_MAP
  89.  
  90. /////////////////////////////////////////////////////////////////////////////
  91. // CVBCircleApp commands
  92.