pb 调用 dll 问题

52vc 2011-04-07 05:34:39
//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则测试通过。
...全文
236 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
jsxhyam321083 2012-05-30
  • 打赏
  • 举报
回复
这个问题我正好也遇到,不晓得怎么办
huwenfeng2001hf 2011-04-08
  • 打赏
  • 举报
回复
指针的char型是可以用ref string的
yyoinge 2011-04-07
  • 打赏
  • 举报
回复
ref string str_queybrxxsql 和 ref string author 分别换为 ref char str_queybrxxsql[] 还有 ref char author[]

取得str_queybrxxsql后,再将它复制给 string 类型的变量,如:
string ls
ls = str_queybrxxsql
pcwe2002 2011-04-07
  • 打赏
  • 举报
回复
你用pb10及以上版本时,函数申明后面加上;ansi
yejihui9527 2011-04-07
  • 打赏
  • 举报
回复
string ls_queybrxxsqlt,ls_authort

=

ref string ls_queybrxxsqlt,ls_authort

680

社区成员

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

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