Re: using the WindowMediaPlayer object on smartphone freezes application

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Marshal.FinalReleaseComObject fixes the problem. Also all event
handlers must be removed.

On Feb 14, 2:18 pm, "Neil Cowburn"
<neilc@[nospamthanks].opennetcf.com> wrote:
I can confirm this behavior. Even calling Marshal.ReleaseComObject() on the
WMP instance has no effect. Also, calling this.Close() instead of
Application.Exit() will close the form, but the application still does not
terminate.

--
Neil Cowburn
Principal Partner
OpenNETCF Consulting, LLC.

http://www.opennetcf.com/

"Cristi Berneanu" <bcri...@xxxxxxxxx> wrote in message

news:1171308789.780417.28040@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Steps to reproduce the problem:

1 - create a new Windows Mobile 5.0 Smartphone device application
2 - Add a reference to wmp.dll
3 - add this code anywhere:

WMPLib.WindowsMediaPlayer p = new
WMPLib.WindowsMediaPlayer();
p.URL = "\\Application Data\\Sounds\\Classic.wma";
p.controls.play();
System.Threading.Thread.Sleep(1000);
Application.Exit();

Could someone please confirm this so I know it isn't a problem on my
side?


.