我创建了一个名为 ClassLibrary1.dll 的 DLL。
它在Class1类中只包含一个函数iscall()。
//Function of DLL
public bool iscalled()
{
return true;
}
Run Code Online (Sandbox Code Playgroud)
现在我创建了一个新的 WINFORM 项目,并在那里添加了我自己的 dll ClassLibrary1的引用。
下面是winForm代码的代码片段
[DllImport("ClassLibrary1.dll")]
public static extern bool iscalled();
public void mydllcall1()
{
bool ud = iscalled();
MessageBox.Show(ud.ToString());
}
Run Code Online (Sandbox Code Playgroud)
当我运行应用程序时,遇到一个错误说明
无法在 DLL“ClassLibrary1.dll”中找到名为“iscall”的入口点
我正在寻找一些解决方案。
感谢致敬
苏哈姆·库马尔,Nathcorp