Opendialog and Mediaplayer
Posted on 1998-05-09
This may sound stupid, and easy to solve. But I cannot find anything about the opendialog in the help file (Delphi 3.0) When I select a file, I load it in Mediaplayer open it, and so on. But if I select nothing and click cancel in the opendialog, I get an error. saying that the MMSystem is...., So how do I trap the error so I can close the opendialog so nothing will happen.
Now I have
If opendialog1.execute then
MediaPlayer1.Filename := Opendialog1.Filename;
So how do I trap the event that nothing is selected, and safely close the opendialog without errordialogs poping up. a small example of how would help.