Results 1 to 3 of 3

Thread: [RESOLVED] Public Property Set Error

  1. #1

    Thread Starter
    Hyperactive Member Jenova's Avatar
    Join Date
    Feb 2006
    Location
    Googleplex
    Posts
    413

    Resolved [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:
    1. Private Declare Function GetCursorPos _
    2.     Lib "user32" ( _
    3.         lpPoint As POINTAPI) _
    4.         As Long
    5.        
    6. Private Declare Function SetCursorPos _
    7.     Lib "user32" ( _
    8.         ByVal X As Long, _
    9.         ByVal y As Long) _
    10.         As Long
    11.  
    12. Private Type POINTAPI
    13.         X As Long
    14.         y As Long
    15. End Type
    16.  
    17. Private m_intX      As Integer
    18. Private m_intY      As Integer
    19.  
    20. Public Property Get XCoordinate() As Integer
    21.    
    22.     Dim udtPoint    As POINTAPI
    23.     Dim lngReturn   As Long
    24.    
    25.     lngReturn = GetCursorPos(udtPoint)
    26.    
    27.     With udtPoint
    28.         m_intX = .X
    29.         m_intY = .y
    30.     End With
    31.    
    32.     XCoordinate = m_intX
    33.    
    34. End Property
    35.  
    36. Public Property Let XCoordinate(ByVal intX As Integer)
    37.     m_intX = intX
    38. End Property
    39.  
    40. Public Property Set XCoordinate(ByVal intX As Integer)
    41.  
    42.     Dim lngReturn   As Long
    43.  
    44.     m_intX = intX
    45.  
    46.     lngReturn = SetCursorPos(X, m_intY)
    47.  
    48. End Property

    Any ideas?

    Regards,

    Jenova

  2. #2
    Oi, fat-rag! bushmobile's Avatar
    Join Date
    Mar 2004
    Location
    on the poop deck
    Posts
    5,592

    Re: [RESOLVED] Public Property Set Error

    an integer isn't an object

    Set for objects
    Let for non-objects

  3. #3

    Thread Starter
    Hyperactive Member Jenova's Avatar
    Join Date
    Feb 2006
    Location
    Googleplex
    Posts
    413

    Re: [RESOLVED] Public Property Set Error

    Ah thank you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width