我希望在XNA游戏中使用DirectInput,但是在引用.dll文件时遇到问题。我正在使用Microsoft Visual Studio C#Express Edition。这正是我的工作:
I would like the use DirectInput in my XNA game however I'm having an issue when it comes to referencing the .dll file. I'm using Microsoft Visual Studio C# Express Edition. This is exactly what I do:
- 右键单击参考
- 选择添加参考
- 导航到.dll文件并单击确定
然后我收到以下错误:
I then receive the following error:
如上所述,我想引用Microsoft.DirectX.DirectInput命名空间,但是我不知道它位于哪个.dll文件中,因此我只选择了 d3dref9.dll。不过,该目录下的每个.dll文件都无法使用,因此我选择的任何一个都给我同样的错误。现在,我已经可以使用其他.dll文件来完成此操作,但是由于某些原因,DirectX文件无法正常工作。我知道这可能是因为这个家伙只是看了第二个
As stated above I would like to reference the Microsoft.DirectX.DirectInput namespace but I don't know which .dll file that it's in so I just picked the "d3dref9.dll". Every .dll file under that directory doesn't work though so any one I pick gives me the same error. Now I've been able to accomplish this with other .dll files but for some reason the DirectX ones wont work. I know it's possible beacuse this guy did it just look at the second line in his code.
我已经安装了DirectX SDK,为什么我不能引用任何.dll文件,如何才能做到?
I have the DirectX SDK installed why can't I reference any of the .dll files and how can I make it so I can?
谢谢!
推荐答案这里的问题是您要添加参考托管DLL仅支持托管DLLS的情况下将其转换为本地DLL。我相信您要查找的DLL是 Microsoft.DirectX.dll 。包含DirectX的托管包装器
The problem here is that you are adding a reference to a native DLL while managed projects only support managed DLLS. I believe the DLL you are looking for is Microsoft.DirectX.dll. That has the managed wrappers for DirectX
更多推荐
引用.dll文件时出现错误信息
发布评论