【WPF】DirectSound编程,出现错误' 类型"Control"在未引用的程序集中定义'
以前在VS2010下用directsound编写过声音播放的程序,最近在VS2015下用directsound写代码,程序出错。
出错代码是:
deviceSound.SetCooperativeLevel(Process.GetCurrentProcess(), MainWindowHandle, CooperativeLevel.Normal);
错误信息是:
void Device.SetCooperativeLevel(IntPtr owner, CooperativeLevel level) (+1重载)
类型"Control"在未引用的程序集中定义。必须添加对程序集"System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561923e089"的引用。
程序是以前的写法,怎么也调试不过去,求解!