用Delphi语言调用C++的动态链接库 (关键字:YAZ工具包 Z39.50联机检索)(200分)

  • 主题发起人 主题发起人 xiongdingfu_2
  • 开始时间 开始时间
X

xiongdingfu_2

Unregistered / Unconfirmed
GUEST, unregistred user!
  我在用delphi语言学首编写Z39.50程序.Z39.50程序一个远程检索对方服务器中的书目数据库的MARC书目的程序.即远程检索分布式数据库.<br>  我用了丹麦一家公司的开发的免费的开发工具包.它是用纯C写成的.现在要用delphi语言调用其动态链接库YAZ.DLL和YAZ.LIB中的函数.<br><br> &nbsp; &nbsp;YAZ下载地址:<br> &nbsp; &nbsp;http://ftp/indexdata.com/pub/yaz<br> &nbsp; &nbsp;在WIN目录下,可以下载yaz包的安装程序,在其bin目录下将所有c语言写成的dll文件和yaz目录中的lib文件考入您的应用程序目录中,再测试应用程序调用.<br><br>  YAZ将自己的函数封装成YAZ.DLL等动态链接库,同时其函数的C文件在ZOOM_connection.h中可以看到.封培的函数有:<br>(1)<br>#include &lt;yaz/zoom.h&gt;<br> &nbsp; &nbsp;<br> &nbsp; &nbsp;ZOOM_connection ZOOM_connection_new (const char *host, int portnum);<br> &nbsp; &nbsp;<br> &nbsp; &nbsp;ZOOM_connection ZOOM_connection_create (ZOOM_options options);<br> &nbsp; &nbsp;<br> &nbsp; &nbsp;void ZOOM_connection_connect(ZOOM_connection c, const char *host,<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; int portnum);<br> &nbsp; &nbsp;void ZOOM_connection_destroy (ZOOM_connection c);<br>______________________________________________<br>(2)<br>ZOOM_query ZOOM_query_create(void);<br><br> &nbsp; &nbsp; void ZOOM_query_destroy(ZOOM_query q);<br><br> &nbsp; &nbsp; int ZOOM_query_prefix(ZOOM_query q, const char *str);<br><br> &nbsp; &nbsp; int ZOOM_query_cql(ZOOM_query s, const char *str);<br><br> &nbsp; &nbsp; int ZOOM_query_sortby(ZOOM_query q, const char *criteria);<br>(3)<br> &nbsp; &nbsp; ZOOM_resultset ZOOM_connection_search(ZOOM_connection,<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ZOOM_query q);<br><br> &nbsp; &nbsp; ZOOM_resultset ZOOM_connection_search_pqf(ZOOM_connection c,<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; const char *q);<br><br> &nbsp; &nbsp; void ZOOM_resultset_destroy(ZOOM_resultset r);<br>(4)void ZOOM_resultset_records (ZOOM_resultset r,<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ZOOM_record *recs,<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;size_t start, size_t count);<br> &nbsp; &nbsp; ZOOM_record ZOOM_resultset_record (ZOOM_resultset s, size_t pos);<br><br> &nbsp; &nbsp; const char *ZOOM_record_get (ZOOM_record rec, const char *type,<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;size_t *len);<br><br> &nbsp; &nbsp; ZOOM_record ZOOM_record_clone (ZOOM_record rec);<br><br> &nbsp; &nbsp; void ZOOM_record_destroy (ZOOM_record rec);<br><br><br>  我现在要问的就是如何在delphi中如何使用程序检测和调用到这些函数???
 
type ZOOM_connection ...<br><br>function ZOOM_connection_new (host : PChar, portnum : Integer) : ZOOM_connection; stdcall; external 'YAZ.DLL';
 
没办法,有些数据类型不知道怎么搞,只能VC或者CB写DLL给DELPHI调用
 
主要问题是有些DLL是16位的,必须转换成32位才可以的,需要转换下[:(]
 
有QQ号码吗,我的是330154262,大家共同讨论Z39.50
 
YAZ工具包(Z39.50)在Delphi中的实现是一个严肃的科研课题。它在图书馆、信息产业等多个领域有广泛的用途。希望大家热烈参加论讨,界时,我们将共同商讨一个结果,并写成报告,发表在本论坛。<br> &nbsp; &nbsp;其中关键技术,实际上就是对C语言的DLL的调用;以及底层协议(ASN.1等的再应用)——如表示层协议的再利用。如果您精心研究它之后,您将对网络协议的构成有绝对深入的理解。<br> &nbsp; 大家在钻研之前,一定要先下载YAZ工具包,并进行安装,否则,讨论可能是空对空。<br>另外,盼大家将研究结果公布。
 
xiongdingfu_2:<br> &nbsp;能给我一份Z39.50协议(中文版)和你的相关资料吗?我的QQ是413128802,E_Mail是Wanjun_@163.net,对你的无私帮助将不胜感谢!
 
dhhwj(Wanjun_@163.net)朋友:<br> &nbsp; &nbsp;因我正忙于考职称, 等20天左右吧!
 
后退
顶部