问题:pb调用外部api失败,错误号R0015,“error calling external funcation %s at ......”,奇怪的地方&s不是我的函数名。下面具体说
外部函数定义:Function Int User_AddText(Int CardNum, Ref User_Text pText, Int iProgramIndex)Library 'EQ2008_Dll.dll'
CardNum,iProgramIndex 没问题,在其他外部函数里能正常传递
User_Text 为结构体
pb里的定义
global type user_text from structure
string chcontent
user_partinfo partinfo
integer bkcolor
user_fontset fontinfo
user_moveset moveset
end type
user_partinfo 的定义
Global Type User_PartInfo From structure
Integer iX
Integer iY
Integer iWidth
Integer iHeight
Integer iFrameMode
Integer FrameColor
End Type
global type user_fontset from structure
string strfontname
integer ifontsize
boolean bfontbold
boolean bfontitaic
boolean bfontunderline
integer colorfont
integer ialignstyle
integer ivalignerstyle
integer irowspace
end type
Global Type User_MoveSet From structure
Integer iActionType
Integer iActionSpeed
Boolean bClear
Integer iHoldTime
Integer iClearSpeed
Integer iClearActionType
Integer iFrameTime
End Type
---------下面是执行脚本
User_Text uText
uText.PartInfo.iFrameMode = 0
uText.PartInfo.iHeight = 32;
uText.PartInfo.iWidth = 64;
uText.PartInfo.iX = 0;
uText.PartInfo.iY = 0;
uText.PartInfo.FrameColor = 0 //rgb(255,0,0);
uText.FontInfo.bFontBold = False;
uText.FontInfo.bFontItaic = False;
uText.FontInfo.bFontUnderline = False;
uText.FontInfo.colorFont = 0 //rgb(255,0,0);
uText.FontInfo.iFontSize = 16;
uText.FontInfo.iAlignStyle = 0;
uText.FontInfo.iRowSpace = 0;
uText.FontInfo.iVAlignerStyle = 0;
uText.FontInfo.strFontName = "宋体";
uText.MoveSet.bClear = False;
uText.MoveSet.iActionSpeed = 4;
uText.MoveSet.iActionType = 0;
uText.MoveSet.iClearActionType = 0;
uText.MoveSet.iClearSpeed = 0;
uText.MoveSet.iFrameTime = 20;
uText.MoveSet.iHoldTime = 0;
Int li_return
uText.BkColor = 0 //rgb(255,0,0)
uText.chContent = "hgfhghjhjhjhjh"
If User_AddText(1,Ref uText,ii_ProgramId) = -1 Then
MessageBox('info','添加文本失败!')
Else
MessageBox('err','添加文本成功!')
End If
调用直接报错
------解决方案--------------------
看看这里吧,我写的代码没有发现这个问题
http://topic.csdn.net/u/20110728/21/eb8dc0e0-c8b6-4183-8ceb-ed1ede58d97a.html?53154
------解决方案--------------------
是不是调用api函数前没给变量分配空间?
string uText=space(200)
--然后再调用试试
--Ref uText