地图的四色猜想:API 声明过程错误?

来源:百度文库 编辑:神马品牌网 时间:2024/04/29 14:56:00
Private Type pointapi
x As Long
y As Long
End Type
Private Type rect
x1 As Integer
x2 As Integer
y1 As Integer
y2 As Integer
End Type
Dim formrect As rect
Dim mousexy As pointapi
Dim mouse_x As Integer, mouse_y As Integer
Public Declare Function GetCursorPos Lib "user32" (lpPoint As pointapi) As Long
Const HWND_TOPMOST = -1
Const HWND_TOP = 0
Const SWP_SHOWWINDOW = &H40
Public Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
运行到Public Declare Function GetCursorPos Lib "user32" (lpPoint As pointapi) As Long
跳出错误对话框
编译错误:private Enun 用户自定义不能作为参数,公共过程的返回类型,公共数据成员,或公共用户定义类型字段使用.
这是为什么?
是哪里用问题?

Private 改为Public 就可以了。

Public Type pointapi
x As Long
y As Long
End Type

Public Type rect
x1 As Integer
x2 As Integer
y1 As Integer
y2 As Integer
End Type