none
如何得到flash 插件的IDispatchEx 接口 RRS feed

  • 常规讨论

  • // d:\projects\ppp\ppp\debug\flash10l.tlh
    //
    // C++ source equivalent of Win32 type library C:\WINDOWS\system32\Macromed\Flash\Flash10l.ocx
    // compiler-generated file created 01/08/11 at 18:16:41 - DO NOT EDIT!

    #pragma once
    #pragma pack(push, 8)

    #include <comdef.h>

    //
    // 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("c5598e60-b307-11d1-b27d-006008c3fbfb"))
    /* interface */ ICanHandleException;
    struct __declspec(uuid("d27cdb6d-ae6d-11cf-96b8-444553540000"))
    /* dispinterface */ _IShockwaveFlashEvents;
    struct /* coclass */ ShockwaveFlash;
    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;
    struct __declspec(uuid("86230738-d762-4c50-a2de-a753e5b1686f"))
    /* dual interface */ IFlashObject;
    struct /* coclass */ FlashObject;
    。。。。。。。。。。。。。。。。。。。。。。。。。
    //////我的代码/////////////
    //IFlashObjectInterfacePtr pifo;
      IUnknown *punk;
      IShockwaveFlashPtr isf;
      IFlashObjectInterfacePtr isfo;
      IFlashObjectPtr isfoo;
      HWND pwnd;
      HRESULT hr;
      IID clid;
      IIDFromString(L"e0920e11-6b65-4d5d-9c58-b1fc5c07dc43",&clid);
     hr=CoCreateInstance(__uuidof(ShockwaveFlash),NULL,CLSCTX_INPROC_SERVER,__uuidof(IShockwaveFlash),(void **)&isf);
       
    this->GetDlgItem(IDC_SHOCKWAVEFLASH2,&pwnd);
      AtlAxAttachControl(isf,pwnd,NULL);
      hr=isf->QueryInterface(__uuidof(IUnknown),(void **)&punk);
      hr=CoCreateInstance(clid,punk,CLSCTX_INPROC_SERVER,__uuidof(IFlashObject),(void **)&isfoo); 这句出错 hr返回值 为 ”没有注册“
      _bstr_t aa="D:\\testflash\\test.swf";
      isf->put_Movie(aa);
      return ;
    2011年1月8日 17:44

全部回复