Solved

Opendialog and Mediaplayer

Posted on 1998-05-09
1
321 Views
Last Modified: 2010-04-06
hi,

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;
 MediaPlayer1.Open;
...
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.

thanks
0
Comment
Question by:hellfire052497
1 Comment
 

Accepted Solution

by:
roosiedb earned 100 total points
ID: 1343922
Hello,

To solve your problem, try this one:

If OpenDialog1.Execute then
BEGIN
  MediaPlayer1.FileName:=OpenDialog1.FileName;
  MediaPlayer1.Open;
END;

I guess you forgot the BEGIN- and END-statements.

Good luck!

Stefan van Roosmalen.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now