PowerBuilder中dll的调用

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

 

int getDepartment(char username char 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;} -->

// 申明 :

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

 

// 调用

string ls_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>"

int recordCount

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

 

记录一下,以防下次用到

已标记关键词 清除标记
相关推荐
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页