home *** CD-ROM | disk | FTP | other *** search
/ distrib.akp.su/Programming/Vb-6+Rus/ / distrib.akp.su.tar / distrib.akp.su / Programming / Vb-6+Rus / COMMON / MSDEV98 / BIN / MFCCLWZ.DLL / SRCDATA / SCRVIEW.CPP < prev    next >
Text File  |  1998-06-18  |  2KB  |  110 lines

  1. /////////////////////////////////////////////////////////////////////////////
  2. // %1
  3.  
  4. IMPLEMENT_DYNCREATE(%1, CScrollView)
  5.  
  6. %1::%1()
  7. {
  8. $$IF(OLEAUTO)
  9.     EnableAutomation();
  10. $$ENDIF
  11. $$IF(OLECREATE)
  12.     
  13.     // To keep the application running as long as an OLE automation 
  14.     //    object is active, the constructor calls AfxOleLockApp.
  15.     
  16.     AfxOleLockApp();
  17. $$ENDIF
  18. }
  19.  
  20. %1::~%1()
  21. {
  22. $$IF(OLECREATE)
  23.     // To terminate the application when all objects created with
  24.     //     with OLE automation, the destructor calls AfxOleUnlockApp.
  25.     
  26.     AfxOleUnlockApp();
  27. $$ENDIF
  28. }
  29. $$IF(OLEAUTO)
  30.  
  31. void %1::OnFinalRelease()
  32. {
  33.     // When the last reference for an automation object is released
  34.     // OnFinalRelease is called.  The base class will automatically
  35.     // deletes the object.  Add additional cleanup required for your
  36.     // object before calling the base class.
  37.  
  38.     CScrollView::OnFinalRelease();
  39. }
  40. $$ENDIF
  41.  
  42.  
  43. BEGIN_MESSAGE_MAP(%1, CScrollView)
  44.     //{{AFX_MSG_MAP(%1)
  45.         // NOTE - the ClassWizard will add and remove mapping macros here.
  46.     //}}AFX_MSG_MAP
  47. END_MESSAGE_MAP()
  48. $$IF(OLEAUTO)
  49.  
  50. BEGIN_DISPATCH_MAP(%1, CScrollView)
  51.     //{{AFX_DISPATCH_MAP(%1)
  52.         // NOTE - the ClassWizard will add and remove mapping macros here.
  53.     //}}AFX_DISPATCH_MAP
  54. END_DISPATCH_MAP()
  55.  
  56. // Note: we add support for IID_I%c to support typesafe binding
  57. //  from VBA.  This IID must match the GUID that is attached to the 
  58. //  dispinterface in the .ODL file.
  59.  
  60. // {%b}
  61. static const IID IID_I%c =
  62. %d;
  63.  
  64. BEGIN_INTERFACE_MAP(%1, CScrollView)
  65.     INTERFACE_PART(%1, IID_I%c, Dispatch)
  66. END_INTERFACE_MAP()
  67. $$ENDIF //OLEAUTO
  68. $$IF(OLECREATE)
  69.  
  70. // {%e}
  71. IMPLEMENT_OLECREATE(%1, "%6", %7)
  72. $$ENDIF //OLECREATE
  73.  
  74. /////////////////////////////////////////////////////////////////////////////
  75. // %1 drawing
  76.  
  77. void %1::OnInitialUpdate()
  78. {
  79.     CScrollView::OnInitialUpdate();
  80.  
  81.     CSize sizeTotal;
  82.     // TODO: calculate the total size of this view
  83.     sizeTotal.cx = sizeTotal.cy = 100;
  84.     SetScrollSizes(MM_TEXT, sizeTotal);
  85. }
  86.  
  87. void %1::OnDraw(CDC* pDC)
  88. {
  89.     CDocument* pDoc = GetDocument();
  90.     // TODO: add draw code here
  91. }
  92.  
  93. /////////////////////////////////////////////////////////////////////////////
  94. // %1 diagnostics
  95.  
  96. #ifdef _DEBUG
  97. void %1::AssertValid() const
  98. {
  99.     CScrollView::AssertValid();
  100. }
  101.  
  102. void %1::Dump(CDumpContext& dc) const
  103. {
  104.     CScrollView::Dump(dc);
  105. }
  106. #endif //_DEBUG
  107.  
  108. /////////////////////////////////////////////////////////////////////////////
  109. // %1 message handlers