Results 1 to 3 of 3

Thread: Out of stack space

  1. #1

    Thread Starter
    Hyperactive Member onerrorgoto's Avatar
    Join Date
    Aug 1999
    Location
    Sweden
    Posts
    330

    Post

    Hi
    I'm developing a "Flashing Led"-ocx using a timer and a shape.
    I created this property:
    Code:
    Public Property Get Flashing() As Boolean
        tmrLed.Enabled = Flashing
    End Property
    
    Public Property Let Flashing(ByVal NewFlashing As Boolean)
        Flashing = NewFlashing
        PropertyChanged "Flashing"
    End Property
    but when I try to change this property while debugging, I get a "Out of stack space"-error.

    I need to be able to turn the timer on/off.

    What am I doing wrong?

    Edited by onerrorgoto on 02-23-2000 at 06:25 AM
    Onerrorgoto

    Dont be to optimistic, the light at the end of the tunnel might be a train

  2. #2
    Hyperactive Member
    Join Date
    Jan 1999
    Location
    Rotterdam, Netherlands
    Posts
    386

    Post

    Not sure if it's the solution for your problem, but the usual property get/let is like this:
    Code:
    Public Property Get MyProp() As Datatype
        MyProp = MyVariableForThisProperty
    End Property
    
    Public Property Let MyProp(New_MyProp As Datatype)
        MyVariableForThisProperty = New_MyProp
        PropertyChanged "MyProp"
    End Propery
    The Get returns the value (so in your case, the Get should return the current state of the timer (enabled or not)
    The Let is to assign a new value, so in your case, you should turn the timer on or off in that property handler.
    Hope this helps.

  3. #3

    Thread Starter
    Hyperactive Member onerrorgoto's Avatar
    Join Date
    Aug 1999
    Location
    Sweden
    Posts
    330

    Post

    Thank you
    I hope I understood you right because this code is working.
    Code:
    Public Property Get Flashing() As Boolean
        Flashing = bolFlashing
    End Property
    
    Public Property Let Flashing(ByVal NewFlashing As Boolean)
        bolFlashing = NewFlashing
        tmrLed.Enabled = bolFlashing
        PropertyChanged "Flashing"
    End Property
    Now I just have to set the property to the correct state when initializing my ocx.

    Onerrorgoto

    Dont be to optimistic, the light at the end of the tunnel might be a train

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