以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  无法在 DLL“ClassLibrary2.dll”中找到名为“autha”的入口点。  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=189675)

--  作者:s111321
--  发布时间:2023/12/16 15:24:00
--  无法在 DLL“ClassLibrary2.dll”中找到名为“autha”的入口点。
这是DLL的语句
Public Class Class1
    Public Function autha(ByVal rc As String) As String
        Dim es As New ServiceReference1.authRequest
        Dim sd As New ServiceReference1.authRequestBody
        sd.access = rc
        es.Body = sd
        Dim web As ServiceReference1.Hoslink
        Dim cc As String = web.auth(es).ToString
        Return cc
    End Function
End Class

全局代码
Public Declare Function Auth Lib "ClassLibrary2.dll" Alias "autha" (ByVal rc As String) As String

--  作者:s111321
--  发布时间:2023/12/16 15:25:00
--  
新手,请教下这是什么问题
--  作者:有点蓝
--  发布时间:2023/12/16 15:33:00
--  
ClassLibrary2.dll从哪来的?使用vs开发的?
--  作者:s111321
--  发布时间:2023/12/16 16:16:00
--  
是的,通过vs2015生成的 
--  作者:有点蓝
--  发布时间:2023/12/16 16:24:00
--  
这种不需要全局代码,去掉。

然后直接添加引用即可:http://www.foxtable.com/webhelp/topics/1936.htm,注意vs的发布的dll必须是.net framework 4.0的

--  作者:s111321
--  发布时间:2023/12/16 16:41:00
--  
这样引用后,如何调用DLL里面的函数
--  作者:有点蓝
--  发布时间:2023/12/16 16:48:00
--  
和vs里的用法完全一样的,加上命名空间引用类型即可

dim a as new dll的命名空间.Class1
dim b as string = a.autha("xxx")
msgbox(b)

--  作者:s111321
--  发布时间:2023/12/18 9:08:00
--  
解决了,感谢蓝老师
[此贴子已经被作者于2023/12/18 9:15:13编辑过]