Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Shockwave Flash in dialog

Shockwave Flash in dialog

Scheduled Pinned Locked Moved C / C++ / MFC
c++comadobetutorialquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Andrew Allen
    wrote on last edited by
    #1

    Does anyone here know how to use the Shockwave Flash OCX in a dialog. I'm not sure which wrapper functions to use to get the thing working. I'm using VC++ 7 with MFC. I have Macromedia Flash 5.0.44.0 installed and I can play Flash in IE6. I want to create a dialog box that plays a Flash (.swf) file. I inserted the Shockwave Flash ActiveX (OCX) control into my dialog. VC++ added an IDispatch wrapper class, CShockwaveflash, to my project and to the dialog class. My dialog is defined like this: class CMyDlg : public CDialog { DECLARE_DYNAMIC(CMyDlg) public: CMyDlg(CWnd* pParent = NULL); // standard constructor virtual ~CMyDlg(); // Dialog Data enum { IDD = IDD_MYDIALOG }; protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support virtual BOOL OnInitDialog(); DECLARE_MESSAGE_MAP() public: CShockwaveflash m_FlashCtrl; }; In my implementation.... BOOL CMyDlg::OnInitDialog() { if (CDialog::OnInitDialog()) { m_FlashCtrl.put_Movie(_T("sample.swf")); m_FlashCtrl.Play(); return TRUE; } return FALSE; } When I run the dialog, the OCX shows the default background but no flash video. I can't find any documentation on using this OCX, even at Macromedia. Any sample code that works? thanks in advance, Andrew

    M 1 Reply Last reply
    0
    • A Andrew Allen

      Does anyone here know how to use the Shockwave Flash OCX in a dialog. I'm not sure which wrapper functions to use to get the thing working. I'm using VC++ 7 with MFC. I have Macromedia Flash 5.0.44.0 installed and I can play Flash in IE6. I want to create a dialog box that plays a Flash (.swf) file. I inserted the Shockwave Flash ActiveX (OCX) control into my dialog. VC++ added an IDispatch wrapper class, CShockwaveflash, to my project and to the dialog class. My dialog is defined like this: class CMyDlg : public CDialog { DECLARE_DYNAMIC(CMyDlg) public: CMyDlg(CWnd* pParent = NULL); // standard constructor virtual ~CMyDlg(); // Dialog Data enum { IDD = IDD_MYDIALOG }; protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support virtual BOOL OnInitDialog(); DECLARE_MESSAGE_MAP() public: CShockwaveflash m_FlashCtrl; }; In my implementation.... BOOL CMyDlg::OnInitDialog() { if (CDialog::OnInitDialog()) { m_FlashCtrl.put_Movie(_T("sample.swf")); m_FlashCtrl.Play(); return TRUE; } return FALSE; } When I run the dialog, the OCX shows the default background but no flash video. I can't find any documentation on using this OCX, even at Macromedia. Any sample code that works? thanks in advance, Andrew

      M Offline
      M Offline
      Mil10
      wrote on last edited by
      #2

      Hi Give the full path of swf file ( m_FlashCtrl.put_Movie(_T("c:\sample.swf")); ) and try. Best wishes..mil10

      A 1 Reply Last reply
      0
      • M Mil10

        Hi Give the full path of swf file ( m_FlashCtrl.put_Movie(_T("c:\sample.swf")); ) and try. Best wishes..mil10

        A Offline
        A Offline
        Andrew Allen
        wrote on last edited by
        #3

        Thanks, that fixed it (with backslashes appropriately escaped, "c:\\flash\\sample.swf"). I had previously tried ".\\sample.swf" to force it to read from the current directory, but that didn't work. So perhaps the full path is always required by Flash.ocx !? cheers! Andrew

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups