Announcement

Collapse
No announcement yet.

Property Get Access

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Property Get Access

    This Code:

    Code:
    #Compile Exe
    #Dim All
    
    #Include "win32api.inc"
    
    Class CArvFile
    
      Interface IArvFileMaipulation
        Inherit  IUnknown
    
        Property Get Frm As Bitmap
          Local bmp As Bitmap
          bmp.bmWidth = 333
          Property = bmp
        End Property
    
      End Interface
    
    End Class
    
    Function PBMain As Long
      Local bmp As Bitmap
    
      Dim ArvFile As IArvFileMaipulation
      Let ArvFile = Class "CArvFile"
    
    '  ArvFile.Frm To bmp           'Ok
    '  call ArvFile.Frm To bmp      'Ok
    *****************************************************************
      bmp = ArvFile.Frm            'Does not Compile - Error 482: Data type mismatch
    *****************************************************************
      ? Str$(bmp.bmWidth)
    
    End Function
    Should compile, right? Am I doing something wrong? Maybe I misunderstand the help file...

    Regards,
    RValois.
    http://www.rvalois.com.br/downloads/free/

  • #2
    Instead of bmp = ArvFile.Frm use TYPE SET bmp = ArvFile.Frm.
    Forum: http://www.jose.it-berater.org/smfforum/index.php

    Comment


    • #3
      Hi José,

      Yes, it does compile the way you sugest.

      The point is that I think it should work the way I wrote to be more consistent.
      See, you can do -> ArvFile.Frm = bmp to set a Property.

      No big deal.

      Thank you,
      RValois.
      http://www.rvalois.com.br/downloads/free/

      Comment

      Working...
      X