标题:[求助]dll问题
只看楼主
lingshangwen
Rank: 1
等 级:新手上路
帖 子:28
专家分:0
注 册:2006-4-26
 问题点数:0 回复次数:1 
[求助]dll问题

我在vc环境中生成dll时,新建了个Win32 Dynamic-Link Library工程,其中文件代码如下
//----myfunction.h文件-----
#ifndef myfunction_h
#define myfunction_h
extern "C" int __declspec(dllexport) __stdcall MyFunction(int a,int b);
#endif

//----myfunction.cpp文件-----
#include "myfunction.h"
#include"stdio.h"
#include"windows.h"

int _stdcall myfunction(int a,int b)
{
return a+b;
}

//----myfunction.def文件-----

LIBRARY myfunction
EXPORTS
myfunction @ 1

生成了myfunction.dll后,用vc的depends工具查看,发现没有导出函数
这是错在那里啊???帮我改正啊

搜索更多相关主题的帖子: dll 
2006-04-26 20:33
cyberkdll
Rank: 1
等 级:新手上路
帖 子:20
专家分:0
注 册:2006-4-25
得分:0 

For exporting the functions in the DLL,it's a good idea to use the __declspec and dllexport keywords rather than using a separate .DEF file.


----------------------------------------------- Cyberkdll
2006-04-27 09:07



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-60390-1-1.html




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

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