UIFlash.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #ifndef __UIFLASH_H__
  2. #define __UIFLASH_H__
  3. #pragma once
  4. // \Utils\Flash11.tlb 为Flash11接口文件,部分方法在低版本不存在,使用需注意
  5. // #import "PROGID:ShockwaveFlash.ShockwaveFlash" \
  6. // raw_interfaces_only, /* Don't add raw_ to method names */ \
  7. // named_guids, /* Named guids and declspecs */ \
  8. // rename("IDispatchEx","IMyDispatchEx") /* fix conflicting with IDispatchEx ant dispex.h */
  9. // using namespace ShockwaveFlashObjects;
  10. #include "Utils/FlashEventHandler.h"
  11. #include "Utils/flash11.tlh"
  12. class CActiveXCtrl;
  13. namespace DuiLib
  14. {
  15. class UILIB_API CFlashUI
  16. : public CActiveXUI
  17. // , public IOleInPlaceSiteWindowless // 透明模式绘图,需要实现这个接口
  18. , public _IShockwaveFlashEvents
  19. , public ITranslateAccelerator
  20. {
  21. DECLARE_DUICONTROL(CFlashUI)
  22. public:
  23. CFlashUI(void);
  24. ~CFlashUI(void);
  25. void SetFlashEventHandler(CFlashEventHandler* pHandler);
  26. virtual bool DoCreateControl();
  27. IShockwaveFlash* m_pFlash;
  28. private:
  29. virtual LPCTSTR GetClass() const;
  30. virtual LPVOID GetInterface( LPCTSTR pstrName );
  31. virtual HRESULT STDMETHODCALLTYPE GetTypeInfoCount( __RPC__out UINT *pctinfo );
  32. virtual HRESULT STDMETHODCALLTYPE GetTypeInfo( UINT iTInfo, LCID lcid, __RPC__deref_out_opt ITypeInfo **ppTInfo );
  33. virtual HRESULT STDMETHODCALLTYPE GetIDsOfNames( __RPC__in REFIID riid, __RPC__in_ecount_full(cNames ) LPOLESTR *rgszNames, UINT cNames, LCID lcid, __RPC__out_ecount_full(cNames) DISPID *rgDispId);
  34. virtual HRESULT STDMETHODCALLTYPE Invoke( DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr );
  35. virtual HRESULT STDMETHODCALLTYPE QueryInterface( REFIID riid, void **ppvObject );
  36. virtual ULONG STDMETHODCALLTYPE AddRef( void );
  37. virtual ULONG STDMETHODCALLTYPE Release( void );
  38. HRESULT OnReadyStateChange (long newState);
  39. HRESULT OnProgress(long percentDone );
  40. HRESULT FSCommand (_bstr_t command, _bstr_t args);
  41. HRESULT FlashCall (_bstr_t request );
  42. virtual void ReleaseControl();
  43. HRESULT RegisterEventHandler(BOOL inAdvise);
  44. // ITranslateAccelerator
  45. // Duilib消息分发给WebBrowser
  46. virtual LRESULT TranslateAccelerator( MSG *pMsg );
  47. private:
  48. LONG m_dwRef;
  49. DWORD m_dwCookie;
  50. CFlashEventHandler* m_pFlashEventHandler;
  51. };
  52. }
  53. #endif // __UIFLASH_H__