I've been experiencing issues with the wxMediaCtrl control causing an "Access Read Violation" and some other exceptions when calling wxMediaCtrl->Load(); I'm fairly new to wxWidgets having only built one project before this one.
This is what I am attempting:
Main::Main() : wxFrame(nullptr, wxID_ANY, "MainFrame", wxDefaultPosition, wxSize(800, 500))
{
SetBackgroundColour(wxColour(0xFAF9F6));
m_mediaCtrl = new wxMediaCtrl(this, wxID_MEDIACTRL, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
m_mediaCtrl->Connect(wxID_MEDIACTRL, wxEVT_MEDIA_LOADED, (wxObjectEventFunction)(wxEventFunction)(wxMediaEventFunction) &Main::OnMediaLoaded);
m_mediaCtrl->ShowPlayerControls(wxMEDIACTRLPLAYERCONTROLS_DEFAULT);
m_mediaCtrl->Load("C:\\Users\\User\\Videos\\Video.mp4");
}
void Main::OnMediaLoaded()
{
m_mediaCtrl->Play();
}
I am using Visual Studio and this is a portion of the output:
Exception thrown at 0x00007FFB0626CF19 in Application.exe: Microsoft C++ exception: bad_hresult at memory location 0x0000009B08AFEE30.
'Application.exe' (Win32): Loaded 'C:\Windows\System32\CompPkgSup.dll'. Cannot find or open the PDB file.
'Application.exe' (Win32): Loaded 'C:\Windows\System32\Windows.Media.dll'. Cannot find or open the PDB file.
'Application.exe' (Win32): Loaded 'C:\Windows\System32\Windows.ApplicationModel.dll'. Cannot find or open the PDB file.
'Application.exe' (Win32): Loaded 'C:\Windows\System32\MSAudDecMFT.dll'. Cannot find or open the PDB file.
'Application.exe' (Win32): Loaded 'C:\Windows\System32\AppXDeploymentClient.dll'. Cannot find or open the PDB file.
'Application.exe' (Win32): Loaded 'C:\Windows\System32\RESAMPLEDMO.DLL'. Cannot find or open the PDB file.
'Application.exe' (Win32): Loaded 'C:\Windows\System32\COLORCNV.DLL'. Cannot find or open the PDB file.
'Application.exe' (Win32): Loaded 'C:\Windows\System32\msmpeg2vdec.dll'. Cannot find or open the PDB file.
Exception thrown at 0x00007FFAC16BA0CD (d3d9.dll) in Application.exe: 0xC0000005: Access violation reading location 0x0000000000000038.
What I've already tried
- Compiling examples from the documentation
- Looking through existing forums and issues
- Using
Bind();instead ofConnect(); - Using different architecture and configuration
Results
Calling Load(); crashes the application and OnMediaLoaded() is never executed.
Edit: I've tried compiling the sample: "mediaplayer" and this is the output:
'mediaplayer.exe' (Win32): Loaded 'C:\Windows\SysWOW64\amdihk32.dll'. Module was built without symbols.
Exception thrown at 0x7748FA72 in mediaplayer.exe: Microsoft C++ exception: bad_hresult at memory location 0x0743F5D0.
'mediaplayer.exe' (Win32): Loaded 'C:\Windows\SysWOW64\CompPkgSup.dll'. Cannot find or open the PDB file.
'mediaplayer.exe' (Win32): Loaded 'C:\Windows\SysWOW64\Windows.Media.dll'. Cannot find or open the PDB file.
'mediaplayer.exe' (Win32): Loaded 'C:\Windows\SysWOW64\Windows.ApplicationModel.dll'. Cannot find or open the PDB file.
'mediaplayer.exe' (Win32): Loaded 'C:\Windows\SysWOW64\MSAudDecMFT.dll'. Cannot find or open the PDB file.
'mediaplayer.exe' (Win32): Loaded 'C:\Windows\SysWOW64\AppXDeploymentClient.dll'. Cannot find or open the PDB file.
'mediaplayer.exe' (Win32): Loaded 'C:\Windows\SysWOW64\RESAMPLEDMO.DLL'. Cannot find or open the PDB file.
'mediaplayer.exe' (Win32): Loaded 'C:\Windows\SysWOW64\COLORCNV.DLL'. Cannot find or open the PDB file.
'mediaplayer.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msmpeg2vdec.dll'. Cannot find or open the PDB file.
Exception thrown at 0x7379CCAD (d3d9.dll) in mediaplayer.exe: 0xC0000005: Access violation reading location 0x00000020.
Edit
I copied the executable to another pc and it seams to work fine there. I’m still not sure what the problem is
Edit
It seams that the error starts here

Thanks for your help.