//--------------------------- //a.cpp #include < windows > WINAPI int add(int a,int b) { return (a+b); } //--------------------------- //a.h WINAPI int add(int a,int b); //--------------------------- //a.def LIBRARY "a";指出DLL的名字 DESCRIPTION 'a Windows Dynamic Link Library' ;描述DLL的用途(此句可选) EXPORTS add;导出函数的名字
Private Declare Function add Lib "a.dll" (ByVal a As Integer, ByVal b As Integer) As Integer改为Private Declare Function add Lib "E:/a.dll" (ByVal a As Integer, ByVal b As Integer) As Integer