引用.dll文件时出现错误信息

编程入门 行业动态 更新时间:2024-10-23 13:34:38
本文介绍了引用.dll文件时出现错误信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我希望在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文件时出现错误信息

本文发布于:2023-11-03 20:17:47,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1555989.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:出现错误   文件   信息   dll

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!