pb如何调用dll,在程序中如何声明外部函数?
zyn01 2002-12-11 04:51:11 如何调用非系统自带的dll? 有谁用过hjd_cw写的mymail.dll?
其中的一个函数是这样写的:
function MyUtil_POP3_Msg_Count(host:pchar;port:integer;UserId,PassWord:pchar): integer;stdcall;
功能 : 直接查询当前邮箱里的邮件数量
参数 : host 服务器名或地址
port 端口(110)
UserId 帐号
PassWord 密码
返回 : <0 失败
>=0 当前邮箱里的邮件数量
我在pb中pb中的代码是这样写的:
声名外部函数:
function long myutil_pop3_msg_count(ref string host,long port,ref string userid,ref string password) library 'd:\fp\mymail.dll'
脚本中的调用:
long i,port=110
string host,userid,password
host='pop3.sina.com.cn'
userid='ad_me'
password='123'
i=MyUtil_POP3_Msg_Count(ref host,port,ref userid,ref password)
但是 一运行程序就提示如下错误:
powerBuilder Application Execution Error (R0015)
Application terminated
Error:Error calling external function myutil_pop3_msg_count at
line 12 in clicked event of object cb_17 of w_proc.
错在哪里呢?