Playing a music file

G

Guest

Ok, hi evryon
now I swear I put this post up yesterday but I cant find it anywhere so ill put it up again
So I'm making a program to play music but the code ive got for the open dialog thing isn't working. This is what iv'e go
\\\\\\\ Private Sub MenuItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnOpen.Clic
Dim OpenFileDialog(
Dim openFile As New System.Windows.Forms.OpenFileDialo
openFile.DefaultExt = "mp3
openFile.Filter = "mp3 files (*.mp3)|*.mp3
openFile.ShowDialog(
Dim filename As Strin
For Each filename In openFile.FileName
Nex
End Su
////////
Now when i try to open an mp3 (when im running the program) and it doesnt doing and the program keeps running.
Now someone gave me code for this about a month ago and it didn't work. I also wnat to be able to play ANY music file on my computer like realplayeror media player
Thanx
 
H

Herfried K. Wagner [MVP]

* "=?Utf-8?B?VG9tIFc=?= said:
now I swear I put this post up yesterday but I cant find it anywhere so ill put it up again.
So I'm making a program to play music but the code ive got for the open dialog thing isn't working. This is what iv'e got
\\\\\\\ Private Sub MenuItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnOpen.Click
Dim OpenFileDialog()
Dim openFile As New System.Windows.Forms.OpenFileDialog
openFile.DefaultExt = "mp3"
openFile.Filter = "mp3 files (*.mp3)|*.mp3"
openFile.ShowDialog()
Dim filename As String
For Each filename In openFile.FileNames
Next
End Sub
/////////
Now when i try to open an mp3 (when im running the program) and it doesnt doing and the program keeps running.
Now someone gave me code for this about a month ago and it didn't work. I also wnat to be able to play ANY music file on my computer like realplayeror media player.

The code above doesn't play anything, it just lets you select files.

<URL:http://www.mentalis.org/soft/class.qpx?id=1>
 
G

Guest

Ok thanx its all going good... almost. when I put thins with "imports" I keep on getting errors syaing " 'Imports' statements must precede any declarations." What does this mean. I'm putting this code for sound files at the bottom of the page after my last end class. What am I doing wrong
Than
 
A

Armin Zingler

G

Guest

HI now if I put the the imports bit at the top it works but if I put the namespace bit (media exception) at the top (after imports) it gets this error and doesnt ru
\\\\\\An unhandled exception of type 'System.Resources.MissingManifestResourceException' occurred in mscorlib.dl

Additional information: Could not find any resources appropriate for the specified culture (or the neutral culture) in the given assembly. Make sure "Form1.resources" was correctly embedded or linked into assembly "media player 2"
baseName: Form1 locationInfo: media_player_2.Form1 resource file name: Form1.resources assembly: media player 2, Version=1.0.1577.36028, Culture=neutral, PublicKeyToken=nul
////////
now when i take the media exception out it works. I checked the folder where the project is and it has a file called "media_player_2.form1.resources" when I put the media exception in and debug it changes its name to "media_player_2.Org.Mentalis.Multimedia.MediaException.resources" why does it do this. (To find this file i went visaul studio projects\media player 2\obj\debug)
Note if I leave the imports at the top and put the media exception at the bottom (after my last end class) the program runs
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top