引用里面已经应用了 Interop.WMPLib.dll  AxInterop.WMPLib.dll在load 之前  实例了  AxWindowsMediaPlayer ax = new AxWindowsMediaPlayer();
在load中 我加入了控件  this.Controls.Add(ax);   在这一步出现错误 提示 “没有注册类别 (异常来自 HRESULT:0x80040154 (REGDB_E_CLASSNOTREG))”但是这个Interop.WMPLib.dll  AxInterop.WMPLib.dll 好像不需要注册吧,我注册也不成功!之前也出现过这个问题,我重启电脑就好了,现在又出现了,重启也不行!在一个方法里面我 使用了 ax 播放音乐 
那位大哥帮帮忙解决下!谢谢

解决方案 »

  1.   

    http://hi.baidu.com/csuhkx/blog/item/3a99f35433337551d0090625.html 参考
      

  2.   

    可能是你的第三方组件使用的某一个COM组件缺少或者未注册, 检查下你那个dll目录有没有 .dlb, .ocx 或者非托管dll,如果有的话使用 regsvr32 命令注册一下。
      

  3.   

    播放个音乐,使这么大身段,#region 播放Mp3
        public class Mp3Player
        {
            // <summary>
            /// 使用API
            /// </summary>
            static uint SND_ASYNC = 0x0001; // play asynchronously 
            static uint SND_FILENAME = 0x00020000; // name is file name
            [DllImport("winmm.dll")]
            static extern int mciSendString(string m_strCmd, string m_strReceive, int m_v1, int m_v2);        [DllImport("Kernel32", CharSet = CharSet.Auto)]
            static extern Int32 GetShortPathName(String path,StringBuilder shortPath, Int32 shortPathLength);        public static void Play(string MusicFile)
            {
                if (!System.IO.File.Exists(MusicFile)) return;
                StringBuilder shortpath=new StringBuilder(80);
                int result = GetShortPathName(MusicFile, shortpath, shortpath.Capacity);
                MusicFile = shortpath.ToString();
                mciSendString(@"close all",null,0,0);
                mciSendString(@"open " + MusicFile + " alias song", null, 0, 0); //打开
                mciSendString("play song",null,0,0); //播放
            }
        }
        #endregion