Note that there are some explanatory texts on larger screens.

plurals
  1. POProperly dispose QuickTime control
    primarykey
    data
    text
    <p>I'm currently developing an application for Windows platform that will be able to play Quick Time videos. The targeted OS versions are Windows XP, Windows Vista and Windows 7.</p> <p>I successfully used the Apple ActiveX QuickTime Control 2.0 (in C#) and everything works well on Windows XP.</p> <p>However, on Vista and Windows 7 I'm facing problems with properly disposing the control. Here are the "steps to reproduce" : - I create the Quick Time control dynamically at runtime and I place it on a panel;</p> <ul> <li><p>I successfully play videos with it;</p></li> <li><p>At some point I close the application main form; the application windows is destroyed and the application will continue to run in the background (doing operations like syncing videos); at this point the control is disposed using IDisposable pattern; I can't explicitly dispose the Movie object (from the ActiveX control) because I get an exception like: "COM object that has been separated from its underlying RCW cannot be used."; I just use (AxQTOControlLib.AxQTControl) player.Dispose(); On Windows XP this is fine but not on Vista and 7</p></li> <li><p>I restore my application (from tool bar where it was running in background) and try to open the video again; At this point an AccessViolationException "Attempted to read/write protected memory" is thrown;</p></li> </ul> <p>My questions are:</p> <ul> <li><p>Why is this happening only on Vista and Windows 7 ?</p></li> <li><p>On XP is a hidden leak ?</p></li> <li><p>What is the recommended way to dispose the control (with its movie object) when it is created at runtime ?</p></li> </ul> <p>I'm now using an explicit Movie.Disconnect() call (although I don't now what this disconnect means because I could not find proper documentation) fallowed by a QuickTimeTerminate() call before the form is closed. While my method is working it is kind of design breaking so I would like to know a better way of doing this.</p> <p>Thank you, Mosu'</p> <p>Update: I just discovered that my method is not workink. I use to players: QuickTime control and Windows Media player control (both ActiveX) and when one fails to play a file the other one is used. I was seeing the output of WindowsMedia player and thinking the methos IS working. So my fix is not working at all. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload