Timer Array

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Scott McNair

    Timer Array

    Hi,

    I'm trying to convert a VB ocx into a .NET dll. This dll ties into several
    automated doors at our facility, and each door has a timer event attached
    to it. When the user swipes his access card, he has a predetermined amount
    of time (5 seconds) to open the door before the strike is re-enabled and
    the door re-locks.

    My problem is that I cannot declare an array of timers in .NET; I get the
    error "'WithEvent s' variables cannot be typed as arrays."

    How would I work around this issue?

    Regards,
    Scott
  • Spam Catcher

    #2
    Re: Timer Array

    Scott McNair <smcnair@beache xpress.takethis partout.comwrot e in
    news:Xns9A506F0 A0BD0Bdonquixot e235gmailco@207 .46.248.16:
    My problem is that I cannot declare an array of timers in .NET; I get
    the error "'WithEvent s' variables cannot be typed as arrays."
    >
    How would I work around this issue?
    Declare an array of timers, and then use AddHandler/RemoveHandler to
    add/remove event registrations manually.

    --
    spamhoneypot@ro gers.com (Do not e-mail)

    Comment

    • Scott McNair

      #3
      Re: Timer Array

      Spam Catcher <spamhoneypot@r ogers.comwrote in
      news:Xns9A50820 AA7041usenethon eypotrogers@127 .0.0.1:
      What kind of timer are you using?
      >
      System.Timer?
      System.Threadin g.Timer?
      System.Window.F orms.Timer?
      Just a generic System.Window.F orms.Timer for this instance.

      Comment

      • Spam Catcher

        #4
        Re: Timer Array

        Scott McNair <smcnair@beache xpress.takethis partout.comwrot e in
        news:Xns9A507C8 5949F6donquixot e235gmailco@207 .46.248.16:
        Spam Catcher <spamhoneypot@r ogers.comwrote in
        news:Xns9A50820 AA7041usenethon eypotrogers@127 .0.0.1:
        >
        >What kind of timer are you using?
        >>
        >System.Timer ?
        >System.Threadi ng.Timer?
        >System.Window. Forms.Timer?
        >
        Just a generic System.Window.F orms.Timer for this instance.
        Since this is a background process, you should use System.Timer.Ti mer.

        Forms.Timer uses the message pump... so if your app is under load, the
        timers are not accurate.

        More information here:

        Gain technical skills through documentation and training, earn certifications and connect with the community




        --
        spamhoneypot@ro gers.com (Do not e-mail)

        Comment

        Working...