PowerBuilder中dll的调用

来源:互联网 发布:黑客攻防编程解析 pdf 编辑:程序博客网 时间:2024/05/18 06:23

      这段时间一个项目需要与医院HIS系统做对接,我提供了一个用delphi开发的dll文件,其中开放了这样一个函数:

 

int getDepartment(char usernamechar password, char *optional,char*resultFile)

 

可是对方工程师在调用时,传递过来的每个参数都只有第一个字符,查找了大量资料才知道初始化时,

一定要加个别名,指定编码,如下:

<!-- /* Font Definitions */ @font-face{font-family:宋体;panose-1:2 1 6 0 3 1 1 1 1 1;mso-font-alt:SimSun;mso-font-charset:134;mso-generic-font-family:auto;mso-font-pitch:variable;mso-font-signature:3 135135232 16 0 262145 0;}@font-face{font-family:"/@宋体";panose-1:2 1 6 0 3 1 1 1 1 1;mso-font-charset:134;mso-generic-font-family:auto;mso-font-pitch:variable;mso-font-signature:3 135135232 16 0 262145 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal{mso-style-parent:"";margin:0cm;margin-bottom:.0001pt;text-align:justify;text-justify:inter-ideograph;mso-pagination:none;font-size:10.5pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";mso-fareast-font-family:宋体;mso-font-kerning:1.0pt;} /* Page Definitions */ @page{mso-page-border-surround-header:no;mso-page-border-surround-footer:no;}@page Section1{size:612.0pt 792.0pt;margin:72.0pt 90.0pt 72.0pt 90.0pt;mso-header-margin:36.0pt;mso-footer-margin:36.0pt;mso-paper-source:0;}div.Section1{page:Section1;}-->

//申明:

functionint getDepartment(ref string loginname,ref string password,ref string optiona,refstring results) library " BaoAnTiJian.dll"  ALIAS FOR "getYuyue;Ansi"

 

//调用

stringls_return,ls_loginname,ls_password ,ls_option

ls_return= "yeyue.xml"

ls_loginname= "test"

ls_password= "test"

ls_option="<opt><begin_date>2010-08-13</begin_date><end_date>2010-08-13</end_date></opt>"

intrecordCount

recordCount=  getDepartment(ls_loginname ,ls_password ,ls_option,ls_return)

 

记录一下,以防下次用到

原创粉丝点击