i get always a "file not found"-error, whats wrong on this code?

Public Declare Function FSOUND_Init Lib "fmodce.dll" Alias "FSOUND_Init" (ByVal mixrate As Integer, ByVal maxchannels As Integer, ByVal flags As FSOUND_INITMODES) As Boolean
Public Declare Function FSOUND_Close Lib "fmodce.dll" Alias "FSOUND_Close" () As Boolean
Public Declare Function FSOUND_GetError Lib "fmodce.dll" Alias "FSOUND_GetError" () As FMOD_ERRORS
Public Declare Function FMUSIC_LoadSong Lib "fmodce.dll" Alias "FMUSIC_LoadSong" (ByVal name As String) As Integer
Public Declare Function FMUSIC_PlaySong Lib "fmodce.dll" Alias "FMUSIC_PlaySong" (ByVal fmodule As Integer) As Boolean


Private Sub cmdOpenSong_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdOpenSong.Click
    OpenFileDialog1.Filter = "Modules (*.s3m, *.it, *.xm, *.mod)|*.s3m;*.it;*.xm;*.mod"
    OpenFileDialog1.FileName = ""

    If Not IO.File.Exists(OpenFileDialog1.FileName) Then
        MsgBox("File doesn't exist or no file selected")
        Exit Sub
    End If
    Label1.Text = OpenFileDialog1.FileName ' filename is correctly displayed
    songHandle = FMUSIC_LoadSong(OpenFileDialog1.FileName) 'songHandle always "0", then "file not found"
    If songHandle <> 0 Then
        'Loading was successful
        cmdCloseSong.Enabled = True
        cmdOpenSong.Enabled = False
        cmdPlaySong.Enabled = True
        'Something went wrong
        MsgBox("An error occured opening the song!" & vbCrLf & _
            FSOUND_GetErrorString(FSOUND_GetError), vbOKOnly)
    End If

End Sub


maybe is LoadSong wrong declared? can someone help?


  • You must to post comments
Showing 0 results
Your Answer

Please first to submit.