⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 appiptransformview.cpp

📁 简单的COM 实际例子 用法1
💻 CPP
字号:
// AppIPTransformView.cpp : implementation of the CAppIPTransformView class
//

#include "stdafx.h"
#include "AppIPTransform.h"

#include "AppIPTransformDoc.h"
#include "AppIPTransformView.h"

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

/////////////////////////////////////////////////////////////////////////////
// CAppIPTransformView

IMPLEMENT_DYNCREATE(CAppIPTransformView, CView)

BEGIN_MESSAGE_MAP(CAppIPTransformView, CView)
	//{{AFX_MSG_MAP(CAppIPTransformView)
	ON_COMMAND(IDM_PLAY, OnPlay)
	ON_WM_SIZE()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CAppIPTransformView construction/destruction

CAppIPTransformView::CAppIPTransformView()
{
	// TODO: add construction code here

}

CAppIPTransformView::~CAppIPTransformView()
{
}

BOOL CAppIPTransformView::PreCreateWindow(CREATESTRUCT& cs)
{
	// TODO: Modify the Window class or styles here by modifying
	//  the CREATESTRUCT cs

	return CView::PreCreateWindow(cs);
}

/////////////////////////////////////////////////////////////////////////////
// CAppIPTransformView drawing

void CAppIPTransformView::OnDraw(CDC* pDC)
{
	CAppIPTransformDoc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);
	// TODO: add draw code for native data here
}

/////////////////////////////////////////////////////////////////////////////
// CAppIPTransformView diagnostics

#ifdef _DEBUG
void CAppIPTransformView::AssertValid() const
{
	CView::AssertValid();
}

void CAppIPTransformView::Dump(CDumpContext& dc) const
{
	CView::Dump(dc);
}

CAppIPTransformDoc* CAppIPTransformView::GetDocument() // non-debug version is inline
{
	ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CAppIPTransformDoc)));
	return (CAppIPTransformDoc*)m_pDocument;
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CAppIPTransformView message handlers

void CAppIPTransformView::OnPlay() 
{
	CString    strFilter = "AVI File (*.avi)|*.avi|";
	strFilter += "MPEG File (*.mpg;*.mpeg)|*.mpg;*.mpeg|";
	strFilter += "All Files (*.*)|*.*|";
	CFileDialog dlgOpen(TRUE, NULL, NULL, OFN_PATHMUSTEXIST | OFN_HIDEREADONLY, 
		strFilter, this);
	if (IDOK != dlgOpen.DoModal()) 
	{
		return;
	}

    WCHAR wchFile[MAX_PATH];
    MultiByteToWideChar(CP_ACP, 0, dlgOpen.GetPathName(), -1, wchFile, MAX_PATH);

    m_Graph.BuildFromFile(wchFile);
    m_Graph.MakeChild(GetSafeHwnd());
    m_Graph.Run();
}

void CAppIPTransformView::OnSize(UINT nType, int cx, int cy) 
{
    CView::OnSize(nType, cx, cy);

    RECT rc;
    GetClientRect(&rc);
    m_Graph.ResizeVideoWindow(&rc);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -