// DlgProxy.cpp : implementation file
//

#include "stdafx.h"
#include "VC6Ex.h"
#include "DlgProxy.h"
#include "VC6ExDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CVC6ExDlgAutoProxy

IMPLEMENT_DYNCREATE(CVC6ExDlgAutoProxy, CCmdTarget)

CVC6ExDlgAutoProxy::CVC6ExDlgAutoProxy()
{
	EnableAutomation();
	
	// To keep the application running as long as an automation 
	//	object is active, the constructor calls AfxOleLockApp.
	AfxOleLockApp();

	ASSERT (AfxGetApp()->m_pMainWnd != NULL);
	ASSERT_VALID (AfxGetApp()->m_pMainWnd);
	ASSERT_KINDOF(CVC6ExDlg, AfxGetApp()->m_pMainWnd);
	m_pDialog = (CVC6ExDlg*) AfxGetApp()->m_pMainWnd;
	m_pDialog->m_pAutoProxy = this;
}

CVC6ExDlgAutoProxy::~CVC6ExDlgAutoProxy()
{
	if (m_pDialog != NULL)
		m_pDialog->m_pAutoProxy = NULL;
	AfxOleUnlockApp();
}

void CVC6ExDlgAutoProxy::OnFinalRelease()
{
	CCmdTarget::OnFinalRelease();
}

BEGIN_MESSAGE_MAP(CVC6ExDlgAutoProxy, CCmdTarget)
	//{{AFX_MSG_MAP(CVC6ExDlgAutoProxy)
		// NOTE - the ClassWizard will add and remove mapping macros here.
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

BEGIN_DISPATCH_MAP(CVC6ExDlgAutoProxy, CCmdTarget)
	//{{AFX_DISPATCH_MAP(CVC6ExDlgAutoProxy)
		// NOTE - the ClassWizard will add and remove mapping macros here.
	//}}AFX_DISPATCH_MAP
END_DISPATCH_MAP()

// Note: we add support for IID_IVC6Ex to support typesafe binding
//  from VBA.  This IID must match the GUID that is attached to the 
//  dispinterface in the .ODL file.

// {D25E3066-44D4-4428-9913-B7C25D39A644}
static const IID IID_IVC6Ex =
{ 0xd25e3066, 0x44d4, 0x4428, { 0x99, 0x13, 0xb7, 0xc2, 0x5d, 0x39, 0xa6, 0x44 } };

BEGIN_INTERFACE_MAP(CVC6ExDlgAutoProxy, CCmdTarget)
	INTERFACE_PART(CVC6ExDlgAutoProxy, IID_IVC6Ex, Dispatch)
END_INTERFACE_MAP()

// {67FB9F5A-F99F-4BD0-AC68-E4A3A7C54B60}
IMPLEMENT_OLECREATE2(CVC6ExDlgAutoProxy, "VC6Ex.Application", 0x67fb9f5a, 0xf99f, 0x4bd0, 0xac, 0x68, 0xe4, 0xa3, 0xa7, 0xc5, 0x4b, 0x60)

/////////////////////////////////////////////////////////////////////////////
// CVC6ExDlgAutoProxy message handlers
