声明如下
type prototypes
Function long GetPrivateProfileStringA(string section, string key, string def,ref string retVal, long size, string filePath) Library "kernel32.dll" alias for "GetPrivateProfileStringA;Ansi"
Function long WritePrivateProfileStringA(string section, string key, string def, string filePath) Library "kernel32.dll" alias for "WritePrivateProfileStringA;Ansi"
end prototypes
调用地方
string ls_section="dw1"
string ls_syntax
long ll_len
string is_file="E:\Project\0000000003.ini"
ll_len = long(ProfileString (is_file, ls_section, 'syntaxlen', '' ))
GetPrivateProfileStringA(ls_section,'syntax','',ls_syntax,ll_len,is_file)
结果报异常如下:
---------------------------
PowerBuilder Application Execution Error (R0015)
---------------------------
Application terminated.
Error: Error calling external function GetPrivateProfileStringA;Ansi at line 7 in clicked event of object cb_1 of w1.
---------------------------
确定
---------------------------
请教前辈们应该如何解决,貌似和书上语法都对的哇。。。
------解决方案--------------------
你用space方法给ls_syntax变量开一段空间然后再传入,如果还不行的话,就只有调试一下了
------解决方案--------------------
不懂,帮顶起来!!!!!
------解决方案--------------------
差不多