|
-
May 7th, 2006, 05:32 AM
#1
Thread Starter
Member
Problem with mp3 player
Hello All i want to make a mp3 player in vb6.I want to make it like when you click file1 the mp3 start playing.
I have written this code in the File1:
Private Sub File1_Click()
Media1.open File1.FileName
End Sub
And the error that the machine gives me say
Run-Time error '438'
Object doesn't support this property or method
What do i need ?
I am a noob
-
May 7th, 2006, 05:49 AM
#2
Re: Problem with mp3 player
It depends on which media player you are using. With Wmp.dll its
VB Code:
WindowsMediaPlayer1.URL = App.Path & "\Your.mp3"
This will load and play the file. 
I'm not sure your code will work because your only showing a FileListBox. You will need a DirListBox to find the path to this file.
Keith
I've been programming with VB for 25 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.
-
May 7th, 2006, 05:54 AM
#3
Thread Starter
Member
Re: Problem with mp3 player
I use windows media 10
the error left but it still not play the song.It say ready i press the button to start and nothing happen
but i thank you very much for your help
p.s i copy-paste it
i have put and a drive list box and a directory
-
May 7th, 2006, 08:18 AM
#4
Fanatic Member
Re: Problem with mp3 player
why not use a common dialog control ?
go to the components then look for micrsoft common dialog control
name it cdl and put this code in the button to open the song
VB Code:
cdl.Filter = "Audio Files(*.mp3,*.wma,*.wav,*.midi)|*.mp3;*.wav;*.wma;*.midi
cdl.DialogTitle = "Open File"
cdl.ShowOpen
Me.WindowsMediaPlayer1.URL = (cdl.FileName)
-
May 7th, 2006, 09:02 AM
#5
Thread Starter
Member
Re: Problem with mp3 player
-
May 7th, 2006, 11:53 AM
#6
Re: Problem with mp3 player
Thats the simple way using a CommonDialog. I thought you needed to use a FilelistBox because you've shown one.
Keith
I've been programming with VB for 25 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|