How to dispose MediaPlayer object?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • William Johnston

    How to dispose MediaPlayer object?


    Hello,

    How do I explictly destruct a MediaPlayer object?

    The compiler complained about overriding Finalize.
    MediaPlayer does not implement IDisposable.

    Any suggestions?

    Thanks,
    William Johnston

  • Andy

    #2
    Re: How to dispose MediaPlayer object?

    On Mar 14, 2:13 pm, "William Johnston" <willi...@tenba se2.comwrote:
    The compiler complained about overriding Finalize.
    MediaPlayer does not implement IDisposable.
    What was it's complaint, exactly?

    Comment

    • =?Utf-8?B?RmFtaWx5IFRyZWUgTWlrZQ==?=

      #3
      RE: How to dispose MediaPlayer object?

      If it is not implimenting IDisposable, then just let it go, as in objMP =
      null.

      "William Johnston" wrote:
      >
      Hello,
      >
      How do I explictly destruct a MediaPlayer object?
      >
      The compiler complained about overriding Finalize.
      MediaPlayer does not implement IDisposable.
      >
      Any suggestions?
      >
      Thanks,
      William Johnston
      >
      >

      Comment

      • Willy Denoyette [MVP]

        #4
        Re: How to dispose MediaPlayer object?

        "William Johnston" <williamj@tenba se2.comwrote in message
        news:1205518419 _5022@news.news ville.com...
        >
        Hello,
        >
        How do I explictly destruct a MediaPlayer object?
        >
        The compiler complained about overriding Finalize.
        MediaPlayer does not implement IDisposable.
        >
        Any suggestions?
        >
        Thanks,
        William Johnston
        >

        MediaPlayer is a COM object, so you have to call Marshal.Release ComObject
        when you want to "release" it's instance.

        Willy.

        Comment

        Working...