Click here to Skip to main content
13,299,436 members (61,133 online)
Click here to Skip to main content


105 bookmarked
Posted 8 Dec 2003

A Basic Media Player

, 10 Jan 2013
Using MCIWnd wrapper class to write a simple media player
// DlgProxy.cpp : implementation file

#include "stdafx.h"
#include "mci.h"
#include "DlgProxy.h"
#include "mciDlg.h"

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

// CmciDlgAutoProxy


	// To keep the application running as long as an automation 
	//	object is active, the constructor calls AfxOleLockApp.

	// Get access to the dialog through the application's
	//  main window pointer.  Set the proxy's internal pointer
	//  to point to the dialog, and set the dialog's back pointer to
	//  this proxy.
	ASSERT (AfxGetApp()->m_pMainWnd != NULL);
	ASSERT_VALID (AfxGetApp()->m_pMainWnd);
	ASSERT_KINDOF(CmciDlg, AfxGetApp()->m_pMainWnd);
//	m_pDialog = (CmciDlg*) AfxGetApp()->m_pMainWnd;
//	m_pDialog->m_pAutoProxy = this;

	// To terminate the application when all objects created with
	// 	with automation, the destructor calls AfxOleUnlockApp.
	//  Among other things, this will destroy the main dialog
//	if (m_pDialog != NULL)
//		m_pDialog->m_pAutoProxy = NULL;
//	AfxOleUnlockApp();

void CmciDlgAutoProxy::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.


BEGIN_MESSAGE_MAP(CmciDlgAutoProxy, CCmdTarget)
		// NOTE - the ClassWizard will add and remove mapping macros here.

BEGIN_DISPATCH_MAP(CmciDlgAutoProxy, CCmdTarget)
		// NOTE - the ClassWizard will add and remove mapping macros here.

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

// {D0E7DC99-C5E5-4B10-9F23-525A0C3600B0}
static const IID IID_Imci =
{ 0xd0e7dc99, 0xc5e5, 0x4b10, { 0x9f, 0x23, 0x52, 0x5a, 0xc, 0x36, 0x0, 0xb0 } };

BEGIN_INTERFACE_MAP(CmciDlgAutoProxy, CCmdTarget)
	INTERFACE_PART(CmciDlgAutoProxy, IID_Imci, Dispatch)

// The IMPLEMENT_OLECREATE2 macro is defined in StdAfx.h of this project
// {79A174D3-F838-49A9-AF52-5324236E6A27}
IMPLEMENT_OLECREATE2(CmciDlgAutoProxy, "mci.Application", 0x79a174d3, 0xf838, 0x49a9, 0xaf, 0x52, 0x53, 0x24, 0x23, 0x6e, 0x6a, 0x27)

// CmciDlgAutoProxy message handlers

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.


This article, along with any associated source code and files, is licensed under The GNU General Public License (GPLv3)


About the Author

M. Bonvari
Iran (Islamic Republic of) Iran (Islamic Republic of)
No Biography provided

You may also be interested in...

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.171207.1 | Last Updated 10 Jan 2013
Article Copyright 2003 by M. Bonvari
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid