OleView 相关

Q:oleview在哪里?

A:打开VS2012 x86 Native Tools Command Prompt,就是那个黑漆漆的命令行窗口,执行where oleview,我这边是 C:\Program Files\Windows Kits\8.0\bin\x86\oleview.exe

 

Q:flash的ProgID和CLSID分别是?

A:win7下用『管理员权限』打开oleview.exe,按照Object Classes -> Grouped by Component Category -> Controls -> Shockware Flash Object
OleView 相关

 

Q:flash ocx支持哪些方法和事件?

A:在Shockware Flash Object上右击选择 View Type Information ... 在弹出窗口中依次点开:ShockwaveFlashObjects -> coclass ShockwaveFlash,IShockwaveFlash中存放方法;_IShockwaveFlashEvents存放事件。
OleView 相关
 

#pragma once
#import "C:\Windows\System32\Macromed\Flash\Flash32_11_7_700_224.ocx" raw_interfaces_only, raw_native_types, named_guids
using namespace ShockwaveFlashObjects;
const UINT FlashObjectID = 1;
class CFlashBrowserView 
	: public CWindowImpl<CFlashBrowserView, CAxWindow>
	, public IDispEventImpl<FlashObjectID, CFlashBrowserView, &DIID__IShockwaveFlashEvents>
{
public:
	DECLARE_WND_SUPERCLASS(_T("FlashView"), CAxWindow::GetWndClassName())
	CComPtr<IShockwaveFlash> m_flashPtr;

	BEGIN_MSG_MAP(CFlashBrowserView)
		MESSAGE_HANDLER(WM_CREATE, OnCreate)
	END_MSG_MAP()
	BEGIN_SINK_MAP(CFlashBrowserView)
		SINK_ENTRY_EX(FlashObjectID, DIID__IShockwaveFlashEvents, 0x96, OnFsCommand)
	END_SINK_MAP()
// Handler prototypes (uncomment arguments if needed):
	LRESULT OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
	{
		HRESULT hr;
		hr = CreateControl(_T("ShockwaveFlash.ShockwaveFlash"), 0, 0);
		ATLASSERT(SUCCEEDED(hr));
		hr = QueryControl(&m_flashPtr);
		DispEventAdvise(m_flashPtr);
		ATLASSERT(SUCCEEDED(hr));
		m_flashPtr->put_Movie(L"D:\\1.swf");
		return 0;
	}
	void play()
	{
		m_flashPtr->Play();
	}
	void OnFsCommand(BSTR command, BSTR args)
	{
		CString cmd(command);
		MessageBox(cmd);
	}
};

 

你可能感兴趣的:(view)