Embedded ctrl in web page
-
Hi all. I am embedding media player 6.4 in my MFC ActiveX control. It can successfully be used in any app. Problem: (happens in XP only it seems) When I embed my control in a web page, it works, but when the page is unloaded, or iexplore is closed, the application crashes and says: Unhandled exception in IEXPLORE.EXE (WMPDXM.DLL): 0xC0000005: Access Violation. The last code I can get to is: File: comip.h void _Release() throw() { if (m_pInterface != NULL) { ---> m_pInterface->Release(); <----- Here. line 662 } } If I release the IMediaPlayerPtr m_pPlayer; I got using QueryInterface: IUnknownPtr pUnk; pUnk = m_Player.GetControlUnknown(); pUnk->QueryInterface(IID_IMediaPlayer,(void**)&m_pPlayer); like this: m_pPlayer->Release(); myself, then it crashes on this line. I am using VC6 on xp. This question belongs to the COM forum, but since it seems dead. Thanks for your help. this is this.
-
Hi all. I am embedding media player 6.4 in my MFC ActiveX control. It can successfully be used in any app. Problem: (happens in XP only it seems) When I embed my control in a web page, it works, but when the page is unloaded, or iexplore is closed, the application crashes and says: Unhandled exception in IEXPLORE.EXE (WMPDXM.DLL): 0xC0000005: Access Violation. The last code I can get to is: File: comip.h void _Release() throw() { if (m_pInterface != NULL) { ---> m_pInterface->Release(); <----- Here. line 662 } } If I release the IMediaPlayerPtr m_pPlayer; I got using QueryInterface: IUnknownPtr pUnk; pUnk = m_Player.GetControlUnknown(); pUnk->QueryInterface(IID_IMediaPlayer,(void**)&m_pPlayer); like this: m_pPlayer->Release(); myself, then it crashes on this line. I am using VC6 on xp. This question belongs to the COM forum, but since it seems dead. Thanks for your help. this is this.
Something is better than nothing. In the destructor, I used this hack. try { m_pPlayer = NULL; } catch(...) { } Instead of m_pPlayer->Release(). Ok, I know this is real bad code, but it seems to work. The release version does not crash, neither does debug version. HeHe. this is this.