Hi! I'm a newbie here, so I really don't know how these forums work, but I have this problem that I wish you could help me solve.
I'm trying to insert sounds in a program for my college course. The program basically allows the user to search a database and add, remove & edit records from the database. It is a very simple program, but I would like to insert some sounds to give it a multimedia touch (and get a better classification from the professor also!), so I inserted the windows media player class in projects>components menu. Then I inserted a media player object in the form, putting the visible property to false.
Next, I call the open method telling him the path of the file to play. Next, I call the play method and he plays the sound in run time but terminates the program and gives me the following message:
Run-time error '-2147467259 (80004005)':
Method 'Play' of object 'IMediaPlayer2' failed
I can't seem to work this one out. Can somebody help me?
Here is the code I've wrote:
Private Sub Form_Load()
frmSplash.cmdSair.Visible = False
frmSplash.Show vbModeless
frmSplash.Refresh
frmSplash.mplSplash.Open "C:\bark.wav"
frmSplash.mplSplash.Play
I'm trying to insert sounds in a program for my college course. The program basically allows the user to search a database and add, remove & edit records from the database. It is a very simple program, but I would like to insert some sounds to give it a multimedia touch (and get a better classification from the professor also!), so I inserted the windows media player class in projects>components menu. Then I inserted a media player object in the form, putting the visible property to false.
Next, I call the open method telling him the path of the file to play. Next, I call the play method and he plays the sound in run time but terminates the program and gives me the following message:
Run-time error '-2147467259 (80004005)':
Method 'Play' of object 'IMediaPlayer2' failed
I can't seem to work this one out. Can somebody help me?
Here is the code I've wrote:
Private Sub Form_Load()
frmSplash.cmdSair.Visible = False
frmSplash.Show vbModeless
frmSplash.Refresh
frmSplash.mplSplash.Open "C:\bark.wav"
frmSplash.mplSplash.Play