| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 429 人关注过本帖
标题:[求助]这个程序错在哪里
只看楼主 加入收藏
lingshangwen
Rank: 1
等 级:新手上路
帖 子:28
专家分:0
注 册:2006-4-26
收藏
 问题点数:0 回复次数:0 
[求助]这个程序错在哪里

我在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入口

我的程序错在那里啊??

图片附件: 游客没有浏览图片的权限,请 登录注册

搜索更多相关主题的帖子: depends include return 工程 
2006-04-26 23:50
快速回复:[求助]这个程序错在哪里
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.013002 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved