Board index » delphi » Can't Release MediaPlayer File

Can't Release MediaPlayer File

Have a simple app (D3) that plays an AVI file after it is unloaded to
the Hd and selected from a FileListBox.
Post Play (MediaPlayer - Stop, I  try and deletefile(xxx) from the HD
- NG

Tried Win DeleteFileWithUndo(xxx) - NG says App can't release etc.

Disable all controls
Set all string vars to Nul or := ' ';  Mediaplayer.filename := ' ';
etc - NG.

As soon as the App is terminated, I can delete the file from Explorer
etc.

Tried to Terminate and Free app, call another app that simply deletes
the file in question and then runs the main app again to start over
and even that won't do it,

By itself this delete file app is fine.

What in the $%^ could be holding the value of the avi file in
Windows98 in this case?

Thanks for any help

Tim Mandeville

 

Re:Can't Release MediaPlayer File


"Tim Mandeville" <vis...@home.com> a crit dans le message news:
3b3e897d.48993238@news...

Quote
> Have a simple app (D3) that plays an AVI file after it is unloaded to
> the Hd and selected from a FileListBox.
> Post Play (MediaPlayer - Stop, I  try and deletefile(xxx) from the HD
> - NG

I think I've come across this problem. It is probably because the media
player is still keeping access to the file, loading a different file frees
it and so you can then delete, move etc, as does closing the app obviously.
I think I resolved it by loading a Nil file or something of that sort.

John

Other Threads