none
mp3 player wont play RRS feed

  • Question

  • Hello guys.

    My name is Andrew. I recently made an simple mp3 player using tutorial online. The code is:

    ..Import Button:

    importdiag.ShowDialog()

    ..importdialog_FileOk

     For Each track As String In importdiag.FileNames
                playlist.Items.Add(track)
            Next

    'Playlist is a listbox and importdialog is an openfiledialoge

    ..Button play:

     AxWindowsMediaPlayer1.URL = playlist.SelectedItem

    ..Button Stop:

     AxWindowsMediaPlayer1.Ctlcontrols.stop()

    ..Button Pause:

     AxWindowsMediaPlayer1.Ctlcontrols.pause()

    Well this is the code. And i have added to my form an "Windows Media Player" control.

    It is good when i run it from the Visual Basic Program Directly, but when i build it, and transfer it to the desktop, it won't run. I noticed that in the build location there are files AxInterop.WMPLib.dll and Interop.WMPLib.dll. If i transfer them also in the same location with my mp3player, then it will work. How can i build the mp3player, so when i move it to the desktop or other location it will not need those two files too, and it will work without crashing???

    Thank you in advance

    Saturday, October 27, 2012 2:40 PM

Answers

  • Your program requires the other files.  They contain the definitions used by your code.  Instead of moving the files, you may consider creating shortcuts to the program.exe file.

    Rudy   =8^D


    Mark the best replies as answers. "Fooling computers since 1971."

    http://thesharpercoder.com/


    Sunday, October 28, 2012 11:19 PM

All replies

  • Your program requires the other files.  They contain the definitions used by your code.  Instead of moving the files, you may consider creating shortcuts to the program.exe file.

    Rudy   =8^D


    Mark the best replies as answers. "Fooling computers since 1971."

    http://thesharpercoder.com/


    Sunday, October 28, 2012 11:19 PM
  • Dear Rudedog2. 

    Thank you very much for your reply to my question. The solution that you offer is workable, but you see, i am not making a simple project for my self. I actually going to add this function to my bigger project which all the user can use. So this solution is not the one that i am looking for. Thank you very much for reply. I really appreciate this.

    I tried to add those two files as a reference but it didn't work . It gave me an error so i removed them. Any idea on how to make my mp3 player to play as standalone application??

    Thanks in advice.  



    Wednesday, October 31, 2012 2:18 PM
  • I don't understand.  How can you compile your code into an executable without the references? 

    .NET compiles into IL assemblies, which are not stand-alone binary executable files.  All .NET assemblies require support assemblies.  At a minimum, .NET portable executable assemblies require assemblies in the .NET Framework, which must be installed on the target machine.

    When Visual Studio successfully compiles your code, any referenced assemblies that not part of the Framework are copied into the output folder.

    Rudy  =8^D


    Mark the best replies as answers. "Fooling computers since 1971."

    http://thesharpercoder.com/


    • Edited by Rudedog2 Friday, November 2, 2012 4:34 PM
    Friday, November 2, 2012 4:33 PM
  • If you configure the extra dll's to be Copy Local/Private: False, msbuild won't copy the extra dll's to the output directory. When an executable runs it will look for assemblies it needs in the directory where the executable is running from, or the GAC. If it can't find an assembly it will call Assembly Resolve. Perhaps reading Resolving Assembly Loads will help.
    Friday, November 2, 2012 5:17 PM