home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2002 November
/
Chip_2002-11_cd1.bin
/
zkuste
/
vbasic
/
Data
/
Utils
/
WME71SDK.exe
/
RCDATA
/
CABINET
/
enccontrolconfig.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
2001-03-02
|
3KB
|
100 lines
// ENCControlConfig.cpp : implementation file
//
#include "stdafx.h"
#include "enccontrol.h"
#include "ENCControlConfig.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// ENCControlConfig dialog
ENCControlConfig::ENCControlConfig(CWnd* pParent /*=NULL*/)
: CDialog(ENCControlConfig::IDD, pParent)
{
//{{AFX_DATA_INIT(ENCControlConfig)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void ENCControlConfig::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(ENCControlConfig)
DDX_Control(pDX, IDC_PROPSHELLCTRLConfig, m_PropShellConfig);
//}}AFX_DATA_MAP
}
void ENCControlConfig::SetEncoder(IWMEncoder* pEncoder)
{
m_pEncoder=pEncoder;
}
BEGIN_MESSAGE_MAP(ENCControlConfig, CDialog)
//{{AFX_MSG_MAP(ENCControlConfig)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// ENCControlConfig message handlers
BOOL ENCControlConfig::OnInitDialog()
{
CDialog::OnInitDialog();
IUnknown* pSourcesPage;
IUnknown* pDescriptionPage;
IUnknown* pAttributesPage;
IUnknown* pEncodingPage;
IUnknown* pOutputPage;
m_PropShellConfig.GetControlUnknown()->QueryInterface(IID_IMSPropShell,(void**)&pPropShell);
HRESULT hrSrc=CoCreateInstance(CLSID_WMEncSourcesAltPage,NULL,CLSCTX_INPROC_SERVER,IID_IUnknown,(void**)&pSourcesPage);
HRESULT hrDesc=CoCreateInstance(CLSID_WMEncDisplayInfoPage,NULL,CLSCTX_INPROC_SERVER,IID_IUnknown,(void**)&pDescriptionPage);
HRESULT hrAttr=CoCreateInstance(CLSID_WMEncAttributesPage,NULL,CLSCTX_INPROC_SERVER,IID_IUnknown,(void**)&pAttributesPage);
HRESULT hrEnc=CoCreateInstance(CLSID_WMEncProfilePage,NULL,CLSCTX_INPROC_SERVER,IID_IUnknown,(void**)&pEncodingPage);
HRESULT hrOut=CoCreateInstance(CLSID_WMEncOutputPage,NULL,CLSCTX_INPROC_SERVER,IID_IUnknown,(void**)&pOutputPage);
pPropShell->AddObject(m_pEncoder);
pPropShell->AddPage(pSourcesPage);
pPropShell->AddPage(pDescriptionPage);
pPropShell->AddPage(pAttributesPage);
pPropShell->AddPage(pEncodingPage);
pPropShell->AddPage(pOutputPage);
pSourcesPage->Release();
pDescriptionPage->Release();
pAttributesPage->Release();
pEncodingPage->Release();
pOutputPage->Release();
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void ENCControlConfig::OnOK()
{
pPropShell->Apply();
m_pEncoder->PrepareToEncode(TRUE);
pPropShell->Release();
CDialog::OnOK();
}
void ENCControlConfig::OnCancel()
{
pPropShell->Release();
CDialog::OnCancel();
}