// [!output IMPL_FILE] : implementation file // #include "stdafx.h" [!if PROJECT_NAME_HEADER] #include "[!output PROJECT_NAME].h" [!endif] #include "[!output HEADER_FILE]" [!if !MERGE_FILE] #ifdef _DEBUG #define new DEBUG_NEW #endif [!endif] // [!output CLASS_NAME] IMPLEMENT_DYNCREATE([!output CLASS_NAME], [!output BASE_CLASS]) [!output CLASS_NAME]::[!output 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 [!output CLASS_NAME]::OnNewDocument() { if (![!output BASE_CLASS]::OnNewDocument()) return FALSE; return TRUE; } [!output CLASS_NAME]::~[!output 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 [!output 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. [!output BASE_CLASS]::OnFinalRelease(); } [!endif] [!if COLESERVERDOC] #ifndef _WIN32_WCE COleServerItem* [!output 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 NULL; } #endif [!endif] BEGIN_MESSAGE_MAP([!output CLASS_NAME], [!output BASE_CLASS]) END_MESSAGE_MAP() [!if AUTOMATION || CREATABLE] BEGIN_DISPATCH_MAP([!output CLASS_NAME], [!output BASE_CLASS]) END_DISPATCH_MAP() // Note: we add support for IID_I[!output 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. // {[!output DISPIID_REGISTRY_FORMAT]} static const IID IID_I[!output CLASS_NAME_ROOT] = [!output DISPIID_STATIC_CONST_GUID_FORMAT]; BEGIN_INTERFACE_MAP([!output CLASS_NAME], [!output BASE_CLASS]) INTERFACE_PART([!output CLASS_NAME], IID_I[!output CLASS_NAME_ROOT], Dispatch) END_INTERFACE_MAP() [!endif] [!if CREATABLE] // {[!output CLSID_REGISTRY_FORMAT]} IMPLEMENT_OLECREATE([!output CLASS_NAME], "[!output TYPEID]", [!output CLSID_IMPLEMENT_OLECREATE_FORMAT]) [!endif] // [!output CLASS_NAME] diagnostics #ifdef _DEBUG void [!output CLASS_NAME]::AssertValid() const { [!output BASE_CLASS]::AssertValid(); } #ifndef _WIN32_WCE void [!output CLASS_NAME]::Dump(CDumpContext& dc) const { [!output BASE_CLASS]::Dump(dc); } #endif #endif //_DEBUG #ifndef _WIN32_WCE // [!output CLASS_NAME] serialization void [!output CLASS_NAME]::Serialize(CArchive& ar) { if (ar.IsStoring()) { // TODO: add storing code here } else { // TODO: add loading code here } } #endif // [!output CLASS_NAME] commands