首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > PB >

pb 调用 dll 有关问题

2013-03-06 
pb 调用dll 问题//c++extern C __declspec(dllexport)bool __stdcall Wirte(char *str_queybrxxsql,int

pb 调用 dll 问题
//c++  extern "C" __declspec(dllexport)bool __stdcall Wirte(char *str_queybrxxsql,
int gsbh, char *author, int blbz, int checklevel) 
//函数申明

function Boolean Wirte(ref string str_queybrxxsql,int  gsbh,ref string author ,int  blbz,int  checklevel) library 'UniEdit.dll' //2.写病历模模式 bool __stdcall Wirte(stu_BaseData *c_basedata) alias for "Wirte;Ansi"

//函数执行

 string ls_queybrxxsqlt,ls_authort
 int li_gsbh,li_BLBZ,li_CheckLevel

  String   ls_dst     
  string   ls_src    
  long   ll_address    

 li_gsbh=1
 li_BLBZ=1
 li_CheckLevel=0

ls_queybrxxsql   =SPACE(100)      
ls_queybrxxsql =  'SELECT * from MZ_LS_GHDJB where BLH =2010988'
 ls_author   =SPACE(100)        
ls_author='1920'

 Wirte( ls_queybrxxsql,li_gsbh, ls_author,li_BLBZ,li_CheckLevel)

//queybrxxsql  ls_author 传入动态库中,只显示取到了一位的值。
queybrxxsql  =S
author=1  
不知是何用原因,pb 9则测试通过。
 
[解决办法]
你用pb10及以上版本时,函数申明后面加上;ansi
[解决办法]
ref string str_queybrxxsql 和 ref string author 分别换为 ref char str_queybrxxsql[] 还有 ref char author[]

取得str_queybrxxsql后,再将它复制给 string 类型的变量,如:
string ls
ls = str_queybrxxsql

热点排行