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

📄 masterobject.h

📁 directshow video 摄像捕捉
💻 H
字号:
// MasterObject.h : Declaration of the CMasterObject

#pragma once

#include "resource.h"       // main symbols

#include "IEVideo.h"
#include <ExDisp.h>
#include <MsHtml.h>
#include "exdispid.h"

#include <dshow.h>


#if defined(_WIN32_WCE) && !defined(_CE_DCOM) && !defined(_CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA)
#error "Single-threaded COM objects are not properly supported on Windows CE platform, such as the Windows Mobile platforms that do not include full DCOM support. Define _CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA to force ATL to support creating single-thread COM object's and allow use of it's single-threaded COM object implementations. The threading model in your rgs file was set to 'Free' as that is the only threading model supported in non DCOM Windows CE platforms."
#endif

// BILLS ERGIO - Hack to fix a break between VS2003 & VS2005
//struct __declspec(uuid("68284faa-6a48-11d0-8c78-00c04fd918b4")) IInputObject;
//_COM_SMARTPTR_TYPEDEF(IInputObject, __uuidof(IInputObject));

// CMasterObject


class ATL_NO_VTABLE CMasterObject :
	public CComObjectRootEx<CComSingleThreadModel>,
	public CComCoClass<CMasterObject, &CLSID_MasterObject>,
	public IObjectWithSiteImpl<CMasterObject>,
	public IOleCommandTarget
{
public:
	CMasterObject()
	{
	}

DECLARE_REGISTRY_RESOURCEID(IDR_MASTEROBJECT)


BEGIN_COM_MAP(CMasterObject)
	COM_INTERFACE_ENTRY(IObjectWithSite)
	COM_INTERFACE_ENTRY(IOleCommandTarget)
END_COM_MAP()



	DECLARE_PROTECT_FINAL_CONSTRUCT()

	HRESULT FinalConstruct()
	{
		return S_OK;
	}

	void FinalRelease()
	{
	}

public:
	STDMETHOD(QueryStatus)(const GUID* pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[], OLECMDTEXT* pCmdText);
	STDMETHOD(Exec)(const GUID*, DWORD nCmdID, DWORD, VARIANTARG*, VARIANTARG* pvaOut);
	STDMETHOD(SetSite)(IUnknown *pUnkSite);

	HRESULT FireUpDirectShow();
	HRESULT InitDirectShow(void);
	HRESULT FreeDirectShow(void);
	void InitMediaDirectory(void);
	void OnSelectFile(HWND hTab, HWND m_hWnd);
	void OnSelectChimp(HWND hTab, HWND m_hWnd);
	BOOL IsWindowsMediaFile(LPTSTR lpszFile);
	HRESULT PrepareMedia(LPTSTR lpszMovie, HWND hTab, HWND m_hWnd);
	void ResetDirectShow(void);
	void OnPlay();
	void OnStop();
	HRESULT RenderWMFile(LPCWSTR wFile);
	void CenterVideo(HWND hTab);
	HRESULT CreateFilter(REFCLSID clsid, IBaseFilter **ppFilter);
	HRESULT RenderOutputPins(IGraphBuilder *pGB, IBaseFilter *pFilter);
	BOOL GetClipFileName(LPTSTR szName);



	// there will be one, and only one, copy of the video class maintained 
	// throughout the application. PlayVideo will set this to null in dtor
	//static PlayVideo* g_Video;

protected:
	CComPtr<IWebBrowser2>     m_pWebBrowser2;
	BOOL                      m_bIsIe7;




};

OBJECT_ENTRY_AUTO(__uuidof(MasterObject), CMasterObject)
//extern UINT __cdecl PlayVideo( LPVOID pParam );







⌨️ 快捷键说明

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