#pragma comment(lib, "comsuppw.lib") //加这个库有什么用 //////////////////////////////////////////////////////////////////////////
// Interfaces imported from flash.ocx #include <comdef.h> //COM 组件头文件 #pragma pack(push, 8) //这个不知道是什么意思 namespace ShockwaveFlashObjects //命名空间
{ //
// Forward references and typedefs
//
struct __declspec(uuid("d27cdb6b-ae6d-11cf-96b8-444553540000"))
/* LIBID */ __ShockwaveFlashObjects;
struct __declspec(uuid("d27cdb6c-ae6d-11cf-96b8-444553540000"))
/* dual interface */ IShockwaveFlash;
struct __declspec(uuid("d27cdb6d-ae6d-11cf-96b8-444553540000"))
/* dispinterface */ _IShockwaveFlashEvents;
struct /* coclass */ ShockwaveFlash;
struct /* coclass */ FlashProp;
struct __declspec(uuid("d27cdb70-ae6d-11cf-96b8-444553540000"))
/* interface */ IFlashFactory;
struct __declspec(uuid("d27cdb72-ae6d-11cf-96b8-444553540000"))
/* interface */ IFlashObjectInterface;
struct __declspec(uuid("a6ef9860-c720-11d0-9337-00a0c90dcaa9"))
/* interface */ IDispatchEx;
struct /* coclass */ FlashObjectInterface; //
// Smart pointer typedef declarations
//
//以上东西不知道有什么用
_COM_SMARTPTR_TYPEDEF(IShockwaveFlash, __uuidof(IShockwaveFlash));
_COM_SMARTPTR_TYPEDEF(_IShockwaveFlashEvents, __uuidof(_IShockwaveFlashEvents));
_COM_SMARTPTR_TYPEDEF(IFlashFactory, __uuidof(IFlashFactory));
_COM_SMARTPTR_TYPEDEF(IDispatchEx, __uuidof(IDispatchEx));
_COM_SMARTPTR_TYPEDEF(IFlashObjectInterface, __uuidof(IFlashObjectInterface)); //以上不知道是什么东西
//
// Type library items
// struct __declspec(uuid("d27cdb6c-ae6d-11cf-96b8-444553540000"))
IShockwaveFlash : IDispatch
{
//
// Property data
//
// virtual HRESULT __stdcall get_ReadyState ( //
/*[out,retval]*/ long * thestate ) = 0;
virtual HRESULT __stdcall get_TotalFrames ( // 获取动画总帧数
/*[out,retval]*/ long * numframes ) = 0;
virtual HRESULT __stdcall get_Playing ( // 获取是否播放中
/*[out,retval]*/ VARIANT_BOOL * Playing ) = 0;
virtual HRESULT __stdcall put_Playing ( //
/*[in]*/ VARIANT_BOOL Playing ) = 0;
virtual HRESULT __stdcall get_Quality (
/*[out,retval]*/ int * Quality ) = 0;
virtual HRESULT __stdcall put_Quality (
/*[in]*/ int Quality ) = 0;
virtual HRESULT __stdcall get_ScaleMode (
/*[out,retval]*/ int * scale ) = 0;
virtual HRESULT __stdcall put_ScaleMode (
/*[in]*/ int scale ) = 0;
virtual HRESULT __stdcall get_AlignMode (
/*[out,retval]*/ int * align ) = 0;
virtual HRESULT __stdcall put_AlignMode (
/*[in]*/ int align ) = 0;
virtual HRESULT __stdcall get_BackgroundColor (
/*[out,retval]*/ long * color ) = 0;
virtual HRESULT __stdcall put_BackgroundColor (
/*[in]*/ long color ) = 0;
virtual HRESULT __stdcall get_Loop (
/*[out,retval]*/ VARIANT_BOOL * Loop ) = 0;
virtual HRESULT __stdcall put_Loop (
/*[in]*/ VARIANT_BOOL Loop ) = 0;
virtual HRESULT __stdcall get_Movie (
/*[out,retval]*/ BSTR * path ) = 0;
virtual HRESULT __stdcall put_Movie (
/*[in]*/ BSTR path ) = 0;
virtual HRESULT __stdcall get_FrameNum (
/*[out,retval]*/ long * FrameNum ) = 0;
virtual HRESULT __stdcall put_FrameNum (
/*[in]*/ long FrameNum ) = 0;
virtual HRESULT __stdcall SetZoomRect (
/*[in]*/ long left,
/*[in]*/ long top,
/*[in]*/ long right,
/*[in]*/ long bottom ) = 0;
virtual HRESULT __stdcall Zoom (
/*[in]*/ int factor ) = 0;
virtual HRESULT __stdcall Pan (
/*[in]*/ long x,
/*[in]*/ long y,
/*[in]*/ int mode ) = 0;
virtual HRESULT __stdcall Play ( ) = 0; // 播放
virtual HRESULT __stdcall Stop ( ) = 0; // 停止
virtual HRESULT __stdcall Back ( ) = 0; // 上一帧
virtual HRESULT __stdcall Forward ( ) = 0; //
virtual HRESULT __stdcall Rewind ( ) = 0; // 返回动画第一帧
virtual HRESULT __stdcall StopPlay ( ) = 0; // 停止播放
virtual HRESULT __stdcall GotoFrame ( // 跳转到指定帧
/*[in]*/ long FrameNum ) = 0;
virtual HRESULT __stdcall CurrentFrame ( // 返回当前帧
/*[out,retval]*/ long * FrameNum ) = 0;
virtual HRESULT __stdcall IsPlaying ( // 动画是否正在播放
/*[out,retval]*/ VARIANT_BOOL * Playing ) = 0;
virtual HRESULT __stdcall PercentLoaded ( // 动画加载的进度百分比
/*[out,retval]*/ long * __MIDL_0011 ) = 0;
virtual HRESULT __stdcall FrameLoaded ( // 帧
/*[in]*/ long FrameNum,
/*[out,retval]*/ VARIANT_BOOL * loaded ) = 0;
virtual HRESULT __stdcall FlashVersion ( // Flash版本 /*[in]*/ VARIANT_BOOL pVal ) = 0;
virtual HRESULT __stdcall get_BGColor (
/*[out,retval]*/ BSTR * pVal ) = 0;
virtual HRESULT __stdcall put_BGColor (
/*[in]*/ BSTR pVal ) = 0;
}; struct __declspec(uuid("d27cdb6d-ae6d-11cf-96b8-444553540000"))
_IShockwaveFlashEvents : IDispatch
{
//
// Wrapper methods for error-handling
// // Methods:
HRESULT OnReadyStateChange (
long newState );
HRESULT OnProgress (
long percentDone );
HRESULT FSCommand (
_bstr_t command,
_bstr_t args );
}; struct __declspec(uuid("d27cdb6e-ae6d-11cf-96b8-444553540000"))
ShockwaveFlash;
// [ default ] interface IShockwaveFlash
// [ default, source ] dispinterface _IShockwaveFlashEvents struct __declspec(uuid("1171a62f-05d2-11d1-83fc-00a0c9089c5a"))
FlashProp;
// [ default ] interface IUnknown struct __declspec(uuid("d27cdb70-ae6d-11cf-96b8-444553540000"))
IFlashFactory : IUnknown
{}; struct __declspec(uuid("a6ef9860-c720-11d0-9337-00a0c90dcaa9"))
IDispatchEx : IDispatch
{
//
// Wrapper methods for error-handling
// HRESULT GetDispID (
_bstr_t bstrName,
unsigned long grfdex,
long * pid );
HRESULT RemoteInvokeEx (
long id,
unsigned long lcid,
unsigned long dwFlags,
struct DISPPARAMS * pdp,
VARIANT * pvarRes,
struct EXCEPINFO * pei,
struct IServiceProvider * pspCaller,
unsigned int cvarRefArg,
unsigned int * rgiRefArg,
VARIANT * rgvarRefArg );
HRESULT DeleteMemberByName (
_bstr_t bstrName,
unsigned long grfdex );
HRESULT DeleteMemberByDispID (
long id );
HRESULT GetMemberProperties (
long id,
unsigned long grfdexFetch,
unsigned long * pgrfdex );
HRESULT GetMemberName (
long id,
BSTR * pbstrName );
HRESULT GetNextDispID (
unsigned long grfdex,
long id,
long * pid );
HRESULT GetNameSpaceParent (
IUnknown * * ppunk ); //
// Raw methods provided by interface
// virtual HRESULT __stdcall raw_GetDispID (
/*[in]*/ BSTR bstrName,
/*[in]*/ unsigned long grfdex,
/*[out]*/ long * pid ) = 0;
}; struct __declspec(uuid("d27cdb72-ae6d-11cf-96b8-444553540000"))
IFlashObjectInterface : IDispatchEx
{}; struct __declspec(uuid("d27cdb71-ae6d-11cf-96b8-444553540000"))
FlashObjectInterface;
// [ default ] interface IFlashObjectInterface } // namespace ShockwaveFlashObjects #pragma pack(pop) using namespace ShockwaveFlashObjects; const CLSID CLSID_ShockwaveFlash =
{ 0xD27CDB6E, 0xAE6D, 0x11cf, {0x96, 0xB8, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00} }; typedef HRESULT (__stdcall *DllGetClassObjectFunc)(REFCLSID rclsid, REFIID riid, LPVOID
问题1:
上面的程序是 flash 自己的
还是 windows 播放 flash 的 Activex ? 2:
#pragma pack(push, 8)
//加一些程序语句
#pragma pack(pop) 这是什么语法?
有什么用? 谢谢!
// Interfaces imported from flash.ocx #include <comdef.h> //COM 组件头文件 #pragma pack(push, 8) //这个不知道是什么意思 namespace ShockwaveFlashObjects //命名空间
{ //
// Forward references and typedefs
//
struct __declspec(uuid("d27cdb6b-ae6d-11cf-96b8-444553540000"))
/* LIBID */ __ShockwaveFlashObjects;
struct __declspec(uuid("d27cdb6c-ae6d-11cf-96b8-444553540000"))
/* dual interface */ IShockwaveFlash;
struct __declspec(uuid("d27cdb6d-ae6d-11cf-96b8-444553540000"))
/* dispinterface */ _IShockwaveFlashEvents;
struct /* coclass */ ShockwaveFlash;
struct /* coclass */ FlashProp;
struct __declspec(uuid("d27cdb70-ae6d-11cf-96b8-444553540000"))
/* interface */ IFlashFactory;
struct __declspec(uuid("d27cdb72-ae6d-11cf-96b8-444553540000"))
/* interface */ IFlashObjectInterface;
struct __declspec(uuid("a6ef9860-c720-11d0-9337-00a0c90dcaa9"))
/* interface */ IDispatchEx;
struct /* coclass */ FlashObjectInterface; //
// Smart pointer typedef declarations
//
//以上东西不知道有什么用
_COM_SMARTPTR_TYPEDEF(IShockwaveFlash, __uuidof(IShockwaveFlash));
_COM_SMARTPTR_TYPEDEF(_IShockwaveFlashEvents, __uuidof(_IShockwaveFlashEvents));
_COM_SMARTPTR_TYPEDEF(IFlashFactory, __uuidof(IFlashFactory));
_COM_SMARTPTR_TYPEDEF(IDispatchEx, __uuidof(IDispatchEx));
_COM_SMARTPTR_TYPEDEF(IFlashObjectInterface, __uuidof(IFlashObjectInterface)); //以上不知道是什么东西
//
// Type library items
// struct __declspec(uuid("d27cdb6c-ae6d-11cf-96b8-444553540000"))
IShockwaveFlash : IDispatch
{
//
// Property data
//
// virtual HRESULT __stdcall get_ReadyState ( //
/*[out,retval]*/ long * thestate ) = 0;
virtual HRESULT __stdcall get_TotalFrames ( // 获取动画总帧数
/*[out,retval]*/ long * numframes ) = 0;
virtual HRESULT __stdcall get_Playing ( // 获取是否播放中
/*[out,retval]*/ VARIANT_BOOL * Playing ) = 0;
virtual HRESULT __stdcall put_Playing ( //
/*[in]*/ VARIANT_BOOL Playing ) = 0;
virtual HRESULT __stdcall get_Quality (
/*[out,retval]*/ int * Quality ) = 0;
virtual HRESULT __stdcall put_Quality (
/*[in]*/ int Quality ) = 0;
virtual HRESULT __stdcall get_ScaleMode (
/*[out,retval]*/ int * scale ) = 0;
virtual HRESULT __stdcall put_ScaleMode (
/*[in]*/ int scale ) = 0;
virtual HRESULT __stdcall get_AlignMode (
/*[out,retval]*/ int * align ) = 0;
virtual HRESULT __stdcall put_AlignMode (
/*[in]*/ int align ) = 0;
virtual HRESULT __stdcall get_BackgroundColor (
/*[out,retval]*/ long * color ) = 0;
virtual HRESULT __stdcall put_BackgroundColor (
/*[in]*/ long color ) = 0;
virtual HRESULT __stdcall get_Loop (
/*[out,retval]*/ VARIANT_BOOL * Loop ) = 0;
virtual HRESULT __stdcall put_Loop (
/*[in]*/ VARIANT_BOOL Loop ) = 0;
virtual HRESULT __stdcall get_Movie (
/*[out,retval]*/ BSTR * path ) = 0;
virtual HRESULT __stdcall put_Movie (
/*[in]*/ BSTR path ) = 0;
virtual HRESULT __stdcall get_FrameNum (
/*[out,retval]*/ long * FrameNum ) = 0;
virtual HRESULT __stdcall put_FrameNum (
/*[in]*/ long FrameNum ) = 0;
virtual HRESULT __stdcall SetZoomRect (
/*[in]*/ long left,
/*[in]*/ long top,
/*[in]*/ long right,
/*[in]*/ long bottom ) = 0;
virtual HRESULT __stdcall Zoom (
/*[in]*/ int factor ) = 0;
virtual HRESULT __stdcall Pan (
/*[in]*/ long x,
/*[in]*/ long y,
/*[in]*/ int mode ) = 0;
virtual HRESULT __stdcall Play ( ) = 0; // 播放
virtual HRESULT __stdcall Stop ( ) = 0; // 停止
virtual HRESULT __stdcall Back ( ) = 0; // 上一帧
virtual HRESULT __stdcall Forward ( ) = 0; //
virtual HRESULT __stdcall Rewind ( ) = 0; // 返回动画第一帧
virtual HRESULT __stdcall StopPlay ( ) = 0; // 停止播放
virtual HRESULT __stdcall GotoFrame ( // 跳转到指定帧
/*[in]*/ long FrameNum ) = 0;
virtual HRESULT __stdcall CurrentFrame ( // 返回当前帧
/*[out,retval]*/ long * FrameNum ) = 0;
virtual HRESULT __stdcall IsPlaying ( // 动画是否正在播放
/*[out,retval]*/ VARIANT_BOOL * Playing ) = 0;
virtual HRESULT __stdcall PercentLoaded ( // 动画加载的进度百分比
/*[out,retval]*/ long * __MIDL_0011 ) = 0;
virtual HRESULT __stdcall FrameLoaded ( // 帧
/*[in]*/ long FrameNum,
/*[out,retval]*/ VARIANT_BOOL * loaded ) = 0;
virtual HRESULT __stdcall FlashVersion ( // Flash版本 /*[in]*/ VARIANT_BOOL pVal ) = 0;
virtual HRESULT __stdcall get_BGColor (
/*[out,retval]*/ BSTR * pVal ) = 0;
virtual HRESULT __stdcall put_BGColor (
/*[in]*/ BSTR pVal ) = 0;
}; struct __declspec(uuid("d27cdb6d-ae6d-11cf-96b8-444553540000"))
_IShockwaveFlashEvents : IDispatch
{
//
// Wrapper methods for error-handling
// // Methods:
HRESULT OnReadyStateChange (
long newState );
HRESULT OnProgress (
long percentDone );
HRESULT FSCommand (
_bstr_t command,
_bstr_t args );
}; struct __declspec(uuid("d27cdb6e-ae6d-11cf-96b8-444553540000"))
ShockwaveFlash;
// [ default ] interface IShockwaveFlash
// [ default, source ] dispinterface _IShockwaveFlashEvents struct __declspec(uuid("1171a62f-05d2-11d1-83fc-00a0c9089c5a"))
FlashProp;
// [ default ] interface IUnknown struct __declspec(uuid("d27cdb70-ae6d-11cf-96b8-444553540000"))
IFlashFactory : IUnknown
{}; struct __declspec(uuid("a6ef9860-c720-11d0-9337-00a0c90dcaa9"))
IDispatchEx : IDispatch
{
//
// Wrapper methods for error-handling
// HRESULT GetDispID (
_bstr_t bstrName,
unsigned long grfdex,
long * pid );
HRESULT RemoteInvokeEx (
long id,
unsigned long lcid,
unsigned long dwFlags,
struct DISPPARAMS * pdp,
VARIANT * pvarRes,
struct EXCEPINFO * pei,
struct IServiceProvider * pspCaller,
unsigned int cvarRefArg,
unsigned int * rgiRefArg,
VARIANT * rgvarRefArg );
HRESULT DeleteMemberByName (
_bstr_t bstrName,
unsigned long grfdex );
HRESULT DeleteMemberByDispID (
long id );
HRESULT GetMemberProperties (
long id,
unsigned long grfdexFetch,
unsigned long * pgrfdex );
HRESULT GetMemberName (
long id,
BSTR * pbstrName );
HRESULT GetNextDispID (
unsigned long grfdex,
long id,
long * pid );
HRESULT GetNameSpaceParent (
IUnknown * * ppunk ); //
// Raw methods provided by interface
// virtual HRESULT __stdcall raw_GetDispID (
/*[in]*/ BSTR bstrName,
/*[in]*/ unsigned long grfdex,
/*[out]*/ long * pid ) = 0;
}; struct __declspec(uuid("d27cdb72-ae6d-11cf-96b8-444553540000"))
IFlashObjectInterface : IDispatchEx
{}; struct __declspec(uuid("d27cdb71-ae6d-11cf-96b8-444553540000"))
FlashObjectInterface;
// [ default ] interface IFlashObjectInterface } // namespace ShockwaveFlashObjects #pragma pack(pop) using namespace ShockwaveFlashObjects; const CLSID CLSID_ShockwaveFlash =
{ 0xD27CDB6E, 0xAE6D, 0x11cf, {0x96, 0xB8, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00} }; typedef HRESULT (__stdcall *DllGetClassObjectFunc)(REFCLSID rclsid, REFIID riid, LPVOID
问题1:
上面的程序是 flash 自己的
还是 windows 播放 flash 的 Activex ? 2:
#pragma pack(push, 8)
//加一些程序语句
#pragma pack(pop) 这是什么语法?
有什么用? 谢谢!
#pragma pack(push, 8)
//加一些程序语句
#pragma pack(pop) 这是什么语法?
有什么用? #pragma pack(n)
它指定了结构成员按n(1,2,4,8,16)字节对齐,如果未指定n,则恢复成默认值。需要注意的是,它并不是指结构体中的每个成员都要按n对齐,而是按照每个成员的大小和n相比较小的值对齐。下面引用MSDN中C++ Preprocessor Reference部分关于pack指令的说明