Windows Media Player Control does not close file handles

Using (or providing) components based on the "Win32" framework

Windows Media Player Control does not close file handles

Postby harsman on Mon May 17, 2010 3:12 pm

If I use the Windows Media Player ActiveX control as an embedded media player in my application, some file handles pointing to the media file remain open after the control has closed. They aren't closed until the Dyalog process shuts down.

I'm not sure if this is because Dyalog doesn't shut down the WMP ActiveX control properly or because of something else. There is no way to explicitly tell the control to close all files as far as I can tell.

Code: Select all
 ∇
 wmptest
 'player'⎕WC'Form'('Coord' 'Pixel')('Size' 48 400)('Event' 'Close' 'wmpoff')
 'wmp'⎕WC'OCXClass' 'Windows Media Player'
 'player.wmp'⎕WC'wmp'
 player.wmp.Open⊂'C:\path\to\wav\file'
 
 ∇
 wmpoff msg
 ⎕EX'wmp'
 ⎕EX'player'


By using Process Explorer I can see that calling the Open method opens four handles to the file, and closing the player window closes two of them. If I force close the remaining open handles from Process Explorer nothing bad seems to happen.

Anyone have any ideas?
harsman
 
Posts: 27
Joined: Thu Nov 26, 2009 12:21 pm

Re: Windows Media Player Control does not close file handles

Postby Vince|Dyalog on Thu May 20, 2010 10:11 am

Hi Joakim,

We are unable to reproduce this issue. I tried under XP and JD tried under Windows 7.

In Process Explorer, I saw 2 handles open under XP, and JD saw one under Windows 7. When the form was closed, we both saw no handles open.

You can also use filemon to see the open and close operations on the file.

Regards,

Vince
Vince|Dyalog
 
Posts: 413
Joined: Wed Oct 01, 2008 9:39 am

Re: Windows Media Player Control does not close file handles

Postby harsman on Fri May 21, 2010 6:42 am

Interesting, I will try it under XP and Win 7 again with the latest version to try and reproduce. Could be some other program (eg AntiVirus) causing this I suppose.
harsman
 
Posts: 27
Joined: Thu Nov 26, 2009 12:21 pm


Return to Windows: GUI, COM/OLE/ActiveX

Who is online

Users browsing this forum: No registered users and 1 guest