Exception: 0xc0000005 When Media Player OCX control is loaded on second time
In a .NET Compact Framework application we are using ocx media player component written by coppercoins.
The media player launches on a new screen when ever user clicks a button. The media player works well on the first time. When we close the media player form and launch it once again on click of the button, it breaks with the following exception
ExceptionCode: 0xc0000005
ExceptionAddress: <address location>
Can someone tell me how to re开发者_运维技巧solve this issue?
Note: we are disposing the media player form as well as the media player activeX wrapper control when the form is closed. The media player is disposed inside the designer code( using as shown below
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
if (disposing)
{
_axPlayer.Dispose();
_axPlayer = null;
}
base.Dispose(disposing);
}
That probably isn't going to be something you'll be able to fix your side and is an issue for forward to the component designer.
As a work around I would suggest retaining the object reference for the duration of the application and not disposing it. Obviously this blows if it occupies a lot of memory.
this solution helped me to fix the issue Media Player Control for .NET Compact Framework
精彩评论