home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1996 December / PCWKCD1296.iso / vjplusb / msdev / bin / mfcclswz.dll / SRCDATA / CMDTARG.CPP < prev    next >
Encoding:
Text File  |  1996-07-12  |  1.7 KB  |  77 lines

  1. /////////////////////////////////////////////////////////////////////////////
  2. // %1
  3.  
  4. IMPLEMENT_DYNCREATE(%1, CCmdTarget)
  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.  
  32. void %1::OnFinalRelease()
  33. {
  34.     // When the last reference for an automation object is released
  35.     // OnFinalRelease is called.  The base class will automatically
  36.     // deletes the object.  Add additional cleanup required for your
  37.     // object before calling the base class.
  38.  
  39.     CCmdTarget::OnFinalRelease();
  40. }
  41. $$ENDIF
  42.  
  43.  
  44. BEGIN_MESSAGE_MAP(%1, CCmdTarget)
  45.     //{{AFX_MSG_MAP(%1)
  46.         // NOTE - the ClassWizard will add and remove mapping macros here.
  47.     //}}AFX_MSG_MAP
  48. END_MESSAGE_MAP()
  49. $$IF(OLEAUTO)
  50.  
  51. BEGIN_DISPATCH_MAP(%1, CCmdTarget)
  52.     //{{AFX_DISPATCH_MAP(%1)
  53.         // NOTE - the ClassWizard will add and remove mapping macros here.
  54.     //}}AFX_DISPATCH_MAP
  55. END_DISPATCH_MAP()
  56.  
  57. // Note: we add support for IID_I%c to support typesafe binding
  58. //  from VBA.  This IID must match the GUID that is attached to the 
  59. //  dispinterface in the .ODL file.
  60.  
  61. // {%b}
  62. static const IID IID_I%c =
  63. %d;
  64.  
  65. BEGIN_INTERFACE_MAP(%1, CCmdTarget)
  66.     INTERFACE_PART(%1, IID_I%c, Dispatch)
  67. END_INTERFACE_MAP()
  68. $$ENDIF //OLEAUTO
  69. $$IF(OLECREATE)
  70.  
  71. // {%e}
  72. IMPLEMENT_OLECREATE(%1, "%6", %7)
  73. $$ENDIF //OLECREATE
  74.  
  75. /////////////////////////////////////////////////////////////////////////////
  76. // %1 message handlers