// Alarm.cpp : implementation file
//

#include "stdafx.h"
#include "mymfc29C.h"
#include "Alarm.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CAlarm

IMPLEMENT_DYNAMIC(CAlarm, CCmdTarget)

CAlarm::CAlarm(DATE time)
{
	TRACE("Entering CAlarm ctor -- vaTime = %f\n", (double) time);
	m_time = time;

	EnableAutomation();
}

CAlarm::~CAlarm()
{
}


void CAlarm::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.

	CCmdTarget::OnFinalRelease();
}


BEGIN_MESSAGE_MAP(CAlarm, CCmdTarget)
	//{{AFX_MSG_MAP(CAlarm)
		// NOTE - the ClassWizard will add and remove mapping macros here.
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

BEGIN_DISPATCH_MAP(CAlarm, CCmdTarget)
	//{{AFX_DISPATCH_MAP(CAlarm)
	DISP_PROPERTY_NOTIFY(CAlarm, "Time", m_time, OnTimeChanged, VT_DATE)
	//}}AFX_DISPATCH_MAP
END_DISPATCH_MAP()

// Note: we add support for IID_IAlarm to support typesafe binding
//  from VBA.  This IID must match the GUID that is attached to the 
//  dispinterface in the .ODL file.

// {AFB93102-3752-492D-879F-CADB12550E78}
static const IID IID_IAlarm =
{ 0xafb93102, 0x3752, 0x492d, { 0x87, 0x9f, 0xca, 0xdb, 0x12, 0x55, 0xe, 0x78 } };

BEGIN_INTERFACE_MAP(CAlarm, CCmdTarget)
	INTERFACE_PART(CAlarm, IID_IAlarm, Dispatch)
END_INTERFACE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CAlarm message handlers

void CAlarm::OnTimeChanged() 
{
	// TODO: Add notification handler code

}

