|
|
|
date: Fri, 3 Jul 2009 22:20:01 -0700,
group: microsoft.public.windowsmedia.sdk
back
Re: Closing Windows Media Player when Remoted
The issue is not releasing the object, rather it is that currently i have no
way of knowing when I should close the remoted session. Hence, i do not know
when to release the object. Is there an event that occurs when the main
window closes?
Thanks
"Alessandro Angeli" wrote:
> From: "SPauka"
>
> > Im using a remoted instance of windows media player,
> > using a background worker thread to read information from
> > windows media player. However, once i close windows media
> > player, the background process (wmplayer) remains open,
> > since my background worker is still connected. The
> > background worker connects when it detects wmplayer.exe
> > opens, i.e. it checks whether the process is running. The
> > code is use to connect is as below (in c#)
>
> WMP terminates when the COM object is fully released. In
> ..NET's COM InterOp, this naturally happens when the object
> is garbage-collected, which requires all of the outstanding
> references to go out of scope and some time to pass until
> the GC decides to act. If you want yo immediately release
> the COM object, invoke
> System.Runtime.InteropServices.FinalReleaseComObject().
>
>
>
>
> --
> // Alessandro Angeli
> // MVP :: DirectShow / MediaFoundation
> // mvpnews at riseoftheants dot com
> // http://www.riseoftheants.com/mmx/faq.htm
>
>
>
date: Sat, 4 Jul 2009 05:18:01 -0700
author: SPauka
|
|