一.說明
vs2010 c#里面不能直接在引用.net組件里面找到directx的組件,所以要手動添加dll引用。
安裝完dxsdk后(目前最新dxsdk_jun10.exe)能在E:\Windows\Microsoft.NET\DirectXfor Managed Code\1.0.2902.0 下面找到相應dll。
如果要使用directsound的話,需要添加
Microsoft.DirectX.dll
Microsoft.DirectX.DirectSound.dll
二.添加引用
1.當前打開的項目下,選擇 References
2.在打開的“Add References”窗口中選中Browse選項卡,找到那兩個dll文件並添加進來
3.添加完引用后可以用
usingMicrosoft.DirectX;
usingMicrosoft.DirectX.DirectSound;
來源:http://blog.csdn.net/woaixiaozhe/article/details/7861340