gpt4 book ai didi

c# - Visual Studio 2012 C# - 导入 DLL

转载 作者:行者123 更新时间:2023-11-28 07:07:33 25 4
gpt4 key购买 nike

我实际上是在尝试在 C# 项目上使用 DLL。问题是,每当我尝试通过将其添加为引用来将其导入我的项目时,我都会收到此错误消息:

A reference to "C:\FilePath\LnkEMP.dll" could not be added.
Check that the file is an assembly or a valid COM component

库是“LnkEMP.dll”,用于名为 Expert/M Plus 的程序。我需要这个库来与这个程序交互。
我认为这个 DLL 是用 C++ 制作的,这可能是我的 C# 项目无法加载它的原因之一。
我试图制作一个 C++ 库并导入它,但这次我收到了另一条错误消息:

A reference to "C:\FilePath\LnkEMP.dll" could not be added,
because it is not an assembly .NET, or not a registered ActiveX control

你知道我应该怎么做才能让它工作吗?

最佳答案

您可以回退到使用 Win32 api 调用动态加载 dll。应该有很多动态加载/调用外部dll的例子。希望您的 dll 附带有关如何使用它的文档。

关于c# - Visual Studio 2012 C# - 导入 DLL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21554549/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com