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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. COM
  4. Using a flash ActiveX control in Win32

Using a flash ActiveX control in Win32

Scheduled Pinned Locked Moved COM
c++comadobequestion
2 Posts 2 Posters 2 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.
  • P Offline
    P Offline
    Pablo Hernandez Valdes
    wrote on last edited by
    #1

    I'm having problems when I try to use a flash ActiveX control in a Win32 application (non-MFC) I don't know why this exception is thrown: First-chance exception at 0x10058561 in MM.exe: 0xC0000005: Access violation reading location 0x00000000. Unhandled exception at 0x10058561 in MM.exe: 0xC0000005: Access violation reading location 0x00000000.:confused: Is something wrong with the code? #import "c:\winxp\system32\macromed\flash\flash.ocx" named_guids ........................... CoInitialize(0); IShockwaveFlash* pFlash; HRESULT hr=CoCreateInstance(CLSID_ShockwaveFlash,NULL,CLSCTX_INPROC_SERVER,IID_IShockwaveFlash,(void**)&pFlash); pFlash->LoadMovie(0,L"test.swf"); Thanks:) Pablo Hernandez Valdes

    A 1 Reply Last reply
    0
    • P Pablo Hernandez Valdes

      I'm having problems when I try to use a flash ActiveX control in a Win32 application (non-MFC) I don't know why this exception is thrown: First-chance exception at 0x10058561 in MM.exe: 0xC0000005: Access violation reading location 0x00000000. Unhandled exception at 0x10058561 in MM.exe: 0xC0000005: Access violation reading location 0x00000000.:confused: Is something wrong with the code? #import "c:\winxp\system32\macromed\flash\flash.ocx" named_guids ........................... CoInitialize(0); IShockwaveFlash* pFlash; HRESULT hr=CoCreateInstance(CLSID_ShockwaveFlash,NULL,CLSCTX_INPROC_SERVER,IID_IShockwaveFlash,(void**)&pFlash); pFlash->LoadMovie(0,L"test.swf"); Thanks:) Pablo Hernandez Valdes

      A Offline
      A Offline
      Andrew Quinn AUS
      wrote on last edited by
      #2

      Hi Pablo, Sounds like the CoCreateInstance didn't work. Access violation was probably due to pFlash being NULL (in debug at least). This is what I used to verify the code worked:

      ShockwaveFlashObjects::IShockwaveFlashPtr pFlash = NULL;
      try
      {
      	HRESULT hr = pFlash.CreateInstance(\_\_uuidof(ShockwaveFlashObjects::ShockwaveFlash));
      	if (SUCCEEDED(hr) && pFlash != NULL)
      	{
      		pFlash->LoadMovie(0,L"C:\\\\Inetpub\\\\wwwroot\\\\pds\\\\try1.swf");
      	}
      }
      catch(\_com\_error& e)
      {
      	TRACE1("EXCEPTION: %s", e.Description());
      }
      

      NOTE: I've used the smart pointer implementation Hope this helps, Andy

      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