紧急求救:PB调用dll的问题

beau75 2009-09-03 02:23:52
源文件的说明如下:

OpenPDF(filename, ignore protect, user pass, owner pass, pdf handle )
Description:
Opens the PDF file for reading and loads the catalog of the pdf for information on the document (such as
number of pages).
Input Fields:
Filename Char * Contains the full path and filename for the input PDF file.
Ignore Protect BOOL TRUE – Ignores password protection on the PDF
FALSE – Passwords will be used (if needed)
User password Char * Password for the person USING the pdf
Owner password Char * Password for the creator of the pdf
Pdf Handle long * Handle for the open PDF
Return codes:
LONG Status returned:
0 – success
1 - couldn't open the PDF file
2 - couldn't read the page catalog
3 - PDF file is damaged
4 - file is encrypted and password was incorrect or not supplied
5 – User does not have permission to read
Usage:
long pdf;
long status;
status = OpenPDF("input.pdf", TRUE, NULL, NULL, &pdf );

我在pb中的使用过程如下
外部声明:
Function long OpenPDF(string filename, Boolean protect, Boolean userpass, Boolean ownerpass, ref long pdfhandle) Library "SII_PDF.dll"

使用方式如下:
long flag1,flag2
long pdfhandle
string ls_s
ls_s="d:\save\00967.pdf"
string ls_m
ls_m='d:\save\00967.txt'

flag1 =OpenPDF(ls_s, TRUE, false, false , pdfhandle)
flag2=ConvertPDFToTextFile(0, 0, pdfhandle, ls_m)

messagebox(string(flag1),flag2)

语法正确,但是运行到时提示错误
...全文
322 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
beau75 2009-09-03
  • 打赏
  • 举报
回复
谢谢1楼和5楼帮我纠正错误,但是声明正确之后,语法检查没问题,但是运行执行到调用就崩溃:
就是那个典型的bad runtime function reference at line 8 ......
很无奈!
pcwe2002 2009-09-03
  • 打赏
  • 举报
回复
申明为:Function ulong OpenPDF(string filename, Boolean protect, string userpass, string ownerpass, ref ulong pdfhandle) Library "SII_PDF.dll"

ownerpass应该是字符串
beau75 2009-09-03
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 xys_777 的回复:]
SII_PDF.dll是不是com组件啊,

用regsvr32 SII_PDF.dll注册一下,在用ConnectToNewObject试试
[/Quote]


注册说是找不到dllregisterserver的输入点
永生天地 2009-09-03
  • 打赏
  • 举报
回复
SII_PDF.dll是不是com组件啊,

用regsvr32 SII_PDF.dll注册一下,在用ConnectToNewObject试试
beau75 2009-09-03
  • 打赏
  • 举报
回复
你这种方法声明,语法倒是没错,但是运行是显示:
bad runtime function reference at line 8........

另,将声明和使用中的ulong 全换成long结果都一样,运行出错!
永生天地 2009-09-03
  • 打赏
  • 举报
回复
Function ulong OpenPDF(string filename, Boolean protect, string userpass, string ownerpass, ref ulong pdfhandle) Library "SII_PDF.dll"

680

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder API 调用
社区管理员
  • API 调用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧