调用API函数显示错误reference argument must be a non-constant...
编号:QA002876
建立日期: 2000年4月24日 最后修改日期:2000年4月24日
所属类别:
zhouq:
操作系统:WIN
编程工具:PB
问题:我在按如何用拨号网络访问sybase的数据库(QA002720 "如何用拨号网络访问sybase的数据库")这篇专题介绍的方法时,当在脚本中调用:
WinExec('rundll32.exe rnaui.dll,RnaDial '+'我 的 连 接 ',9)
(我已在拨号网络中添加了’我的连接‘。)
每次编译时都报错。错误为:
reference argument must be a non-constant and non-readonly variable referencre.
望你指点迷津。
回答:
非常简单,要么去掉WinExec函数说明中的第一个参数前的ref,要么将第一个参数先用一个字符串变量保存,然后传递给WinExec函数。因为ref要求一个变量,具体请参考在线帮助中的'Declaring external functions'。
此问题由rodgers 回答。
| |
|
|
| |
|
|