中石化官方客服电话:有关vb语言编程的API函数问题
来源:百度文库 编辑:中科新闻网 时间:2024/05/13 17:08:19
为什么我在通用部分里声明了以下语句后出现用户定义类型未定义的情况?是不是还有什么没有加载或其他问题,我应该怎么做?
Declare Function GetCursorPos Lib "user32" (lpPoint As PoinTAPI) As Long
Declare Function SetCursorPos Lib "user32" (ByVal x As Long, ByVal y As Long) As Long
Declare Function GetCursorPos Lib "user32" (lpPoint As PoinTAPI) As Long
Declare Function SetCursorPos Lib "user32" (ByVal x As Long, ByVal y As Long) As Long
你的问题大概是你不小心造成的:
应该写成
public Declare Function GetCursorPos Lib "user32" (lpPoint As PoinTAPI) As Long
public Declare Function SetCursorPos Lib "user32" (ByVal x As Long, ByVal y As Long) As Long
在通用模块中要加上关键字:public
如果你没有加入此关键字,那就会报找不到的错误,你试一试吧!
Type POINTAPI
x As Long
y As Long
End Type
加在前面