问题算是解决了吧
也不知道我说的对不
VB.NET下编写的DLL不是正规的DLL
使用declare或者DLLIMPORTS是没用的
我在项目的引用中加入了A.DLL
然后在窗体代码中实例化A.DLL
PUBLIC AA AS NEW A.DLL
-----------------------
然后调用函数
dim a,b as string
a=AA.FA()
b=AA.FB()
调试成功
不知道这样的做法对不对???
我试着简单的写了一个在VB.NET下的DLL命名为A.DLL,写了两个函数,没有参数
Imports System.Runtime.InteropServices
<ComClass()> Public Class ClassA
Public Function FA() As string
'函数过程
End Function
Public Function FB() As string
'函数过程
End Function
End Class
生成后
将DLL直接COPY到BIN\DEBUG目录下 和EXE在同一个目录
又在窗体代码中加入了
Imports System.Runtime.InteropServices
punlic declare auto function FA lib "A.DLL" alias "FA" () as string
punlic declare auto function FB lib "A.DLL" alias "FB" () as string
---------------------------------------------------------------------
然后调用函数
dim a,b as string
a=FA()
b=FB()
可是在调试时提示:无法在 DLL“A.dll”中找到名为“FA”的入口点。
请高手指点一二