mosu
mosu

Reputation: 587

Properly dispose QuickTime control

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.

I successfully used the Apple ActiveX QuickTime Control 2.0 (in C#) and everything works well on Windows XP.

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;

My questions are:

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.

Thank you, Mosu'

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.

Upvotes: 3

Views: 1162

Answers (1)

simon.d
simon.d

Reputation: 2531

Lots of people seem to be having this error.

This page offers an interesting approach: http://www.theusenetarchive.com/usenet-message-how-to-properly-destroy-quicktime-activex-object-10384503.htm

The crash occurs because of file handles still being open.  I was 'unloading' movies from the Quicktime control by wiring a null string to the FileName or URL property.  Quicktime doesn't handle this correctly and leaves the original file open.  So instead I wired a path to an actual image file (Quicktime does images too) that was all black.  Eveything seems fine now.

Upvotes: 1

Related Questions