[求助]这个程序错在哪里
我在vc环境中生成dll时,新建了个Win32 Dynamic-Link Library工程,其中文件代码如下
/* 文件名:dll.h */
#ifndef DLL_H
#define DLL_H
extern "C" int __declspec(dllexport) __stdcall add(int x, int y);
#endif
/* 文件名:dll.cpp */
#include "dll.h"
int __stdcall add(int x, int y)
{
return x + y;
}
//----dll.def文件-----
LIBRARY dll
EXPORTS
add @ 1
生成了myfunction.dll后,用vc的depends工具查看,发现导出函数为_add@8
在vb中调用此dll代码如下:
Option Explicit
Private Declare Function add Lib "e:\\dll\dll.dll" (ByVal x As Integer, ByVal y As Integer) As Integer
_______________________________________________________________________
Private Sub Command1_Click()
Dim m As Integer
Dim n As Integer
Dim x As Integer
m = Text1.Text
n = Text2.Text
x = add(m, n)
MsgBox x
Text1.Text = ""
Text2.Text = ""
End Sub
运行是提示找不到dll入口
我的程序错在那里啊??