|
-
Nov 4th, 2006, 03:27 PM
#1
Thread Starter
Hyperactive Member
[RESOLVED] Public Property Set Error
Hi there, i was trying to make a property for the first time and i have an error with one of the three; the Set Property. This is the error message i get.
Compiler Error:
Definitions of property procedures for the same property are inconsistent, or property procedure has an optional parameter, a ParamArray, or an invalid set final parameter.
I have tried renaming the property, changing the paremeter name and i have my final value set, so i am now sure how to go on.
My code is illustrated below
VB Code:
Private Declare Function GetCursorPos _
Lib "user32" ( _
lpPoint As POINTAPI) _
As Long
Private Declare Function SetCursorPos _
Lib "user32" ( _
ByVal X As Long, _
ByVal y As Long) _
As Long
Private Type POINTAPI
X As Long
y As Long
End Type
Private m_intX As Integer
Private m_intY As Integer
Public Property Get XCoordinate() As Integer
Dim udtPoint As POINTAPI
Dim lngReturn As Long
lngReturn = GetCursorPos(udtPoint)
With udtPoint
m_intX = .X
m_intY = .y
End With
XCoordinate = m_intX
End Property
Public Property Let XCoordinate(ByVal intX As Integer)
m_intX = intX
End Property
Public Property Set XCoordinate(ByVal intX As Integer)
Dim lngReturn As Long
m_intX = intX
lngReturn = SetCursorPos(X, m_intY)
End Property
Any ideas?
Regards,
Jenova
-
Nov 4th, 2006, 04:04 PM
#2
Re: [RESOLVED] Public Property Set Error
an integer isn't an object
Set for objects
Let for non-objects
-
Nov 5th, 2006, 02:22 PM
#3
Thread Starter
Hyperactive Member
Re: [RESOLVED] Public Property Set Error
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|