注册 登录
编程论坛 PowerBuilder

pb调用VC写的DLL文件

love_2008 发布于 2006-06-29 09:39, 1083 次点击
请问我要是在VC中写个DLL文件,我如何在PB中调用那???
Function int add(int a,int b) LIBRARY "jiami.dll" 这样声明后怎么总是报错哪???报调用DLL时出错。
VC下的DLL文件是这样的:
_declspec(dllexport) int add(int a,int b)
{
return a+b;
}

请各位帮下忙 挺急的。。。。
2 回复
#2
fgypblt2006-06-29 09:55
c++的dll文件你介绍的不详细。
一般不涉及设备的纯粹运算算法建议使用pb函数实现。

试试
Function int add(int a,int b,ref int c) LIBRARY "jiami.dll"//假设均为整形数据
调用:
int a,b,c.result

result=add(a,b,c)//假设dll定义返回0为正常执行
if result=0 then
messagebox('结果',''+string(c))
else
messagebox('提示','出错')
end if
#3
love_20082006-06-29 10:02
这个是必须要用DLL来实现的 因为还有其他程序调用(其他语言写的)
按照那样还是出错
1