// $impl_file$ : implementation file // #include "pch.h" [!if PROJECT_NAME_HEADER] #include "$projectname$.h" [!endif] #include "$header_file$" // $class_name$ IMPLEMENT_DYNCREATE($class_name$, $base_class$) $class_name$::$class_name$() { [!if AUTOMATION || CREATABLE] EnableAutomation(); [!endif] [!if CREATABLE] // To keep the application running as long as an OLE automation // object is active, the constructor calls AfxOleLockApp. AfxOleLockApp(); [!endif] } BOOL $class_name$::OnNewDocument() { if (!$base_class$::OnNewDocument()) return FALSE; return TRUE; } $class_name$::~$class_name$() { [!if CREATABLE] // To terminate the application when all objects created with // with OLE automation, the destructor calls AfxOleUnlockApp. AfxOleUnlockApp(); [!endif] } [!if AUTOMATION || CREATABLE] void $class_name$::OnFinalRelease() { // When the last reference for an automation object is released // OnFinalRelease is called. The base class will automatically // deletes the object. Add additional cleanup required for your // object before calling the base class. $base_class$::OnFinalRelease(); } [!endif] [!if COLESERVERDOC] #ifndef _WIN32_WCE COleServerItem* $class_name$::OnGetEmbeddedItem() { // OnGetEmbeddedItem is called by the framework to get the COleServerItem // that is associated with the document. It is only called when necessary. // Instead of returning null, return a pointer to a new COleServerItem // derived class that is used in conjunction with this document, then // remove the ASSERT(FALSE) below. // (i.e., return new CMyServerItem.) ASSERT(FALSE); // remove this after completing the TODO return nullptr; } #endif [!endif] BEGIN_MESSAGE_MAP($class_name$, $base_class$) END_MESSAGE_MAP() [!if AUTOMATION || CREATABLE] BEGIN_DISPATCH_MAP($class_name$, $base_class$) END_DISPATCH_MAP() // Note: we add support for IID_I$class_name_root$ to support typesafe binding // from VBA. This IID must match the GUID that is attached to the // dispinterface in the .IDL file. // {$guid_dispiid$} static const IID IID_I$class_name_root$ = $guid_dispiid_staticconst$; BEGIN_INTERFACE_MAP($class_name$, $base_class$) INTERFACE_PART($class_name$, IID_I$class_name_root$, Dispatch) END_INTERFACE_MAP() [!endif] [!if CREATABLE] // {$guid_clsid$} IMPLEMENT_OLECREATE($class_name$, "$typeid$", $guid_clsid_olecreate$) [!endif] // $class_name$ diagnostics #ifdef _DEBUG void $class_name$::AssertValid() const { $base_class$::AssertValid(); } #ifndef _WIN32_WCE void $class_name$::Dump(CDumpContext& dc) const { $base_class$::Dump(dc); } #endif #endif //_DEBUG #ifndef _WIN32_WCE // $class_name$ serialization void $class_name$::Serialize(CArchive& ar) { if (ar.IsStoring()) { // TODO: add storing code here } else { // TODO: add loading code here } } #endif // $class_name$ commands