Answered adding windows media player to forms

  • Tuesday, September 11, 2007 7:54 PM
     
     
    i recently saw a thread about adding windows media player to forms so it can play multimedia
    does anyone know how to does this becasue the thread i saw did not help

All Replies

  • Tuesday, September 11, 2007 8:10 PM
     
     
    alright i got it in the forms but i get this error

    An unhandled exception of type 'System.IO.FileNotFoundException' occurred in System.Windows.Forms.dll

    Additional information: Could not load file or assembly 'Interop.WMPLib.1.0, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
  • Wednesday, September 12, 2007 7:27 AM
     
     

    How did you go with this? I have been using Win Media Player without issue until today. It runs fine but I receive the same message in VSS:

    Additional information: Could not load file or assembly 'Interop.WMPLib.1.0, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

  • Wednesday, September 12, 2007 8:07 AM
     
     

    Never mind.

     

    I had saved a backup last night. Works fine. No idea how the other version got corrupted because I didn't change anything other than totally unrelated code.

     

  • Thursday, September 13, 2007 7:04 PM
     
     
    i have the same problem that you had can u please help me
  • Monday, September 17, 2007 2:12 AM
    Moderator
     
     Answered

     Big Bill wrote:
    alright i got it in the forms but i get this error

    An unhandled exception of type 'System.IO.FileNotFoundException' occurred in System.Windows.Forms.dll

    Additional information: Could not load file or assembly 'Interop.WMPLib.1.0, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

    Hi Bill,

     

    Based on my understanding, you are getting this error message when you drag&drop a windows media player com component from toolbox to your form. In this case, VS IDE will generate wrapper classes for the com component automatically after you build your project, e.g. AxInterop.WMPLib.dll and Interop.WPMLib.dll, there are generated to output directory(e.g. bin, debug or release folder), when you run form application from IDE(Ctrl+F5), the working directory of your windows form application is in project directory, which is under "solution_name\project_name", there is no wrapper dll exist here, so it reports a file not found exception. To resolve the problem, keep a copy of wrapper dlls in project directory as well.

     

    thanks

    rico