Results 1 to 4 of 4

Thread: How about giving me the component code

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2000
    Posts
    879

    Lightbulb

    I was thinking of just actually making the component but i never learnt how. So if someone can actually help me out I would appreciate it!
    Visual Basic 6.0
    Visual C++ 5
    Delphi 5


  2. #2

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2000
    Posts
    879
    I need to make a timer component that can have an interval of over 10 minutes.
    Visual Basic 6.0
    Visual C++ 5
    Delphi 5


  3. #3
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649
    You could use the Multi Media timer functions. Look the following up in MSDN Library for starters:

    timeGetDevCaps()
    timeBeginPeriod()
    timeEndPeriod()
    timeSetEvent()
    timeKillEvent()

  4. #4
    Fanatic Member
    Join Date
    Aug 2000
    Posts
    736

    Lightbulb

    This is not component code, but I have been playing around with the API that V(ery) Basic posted in response to your original post. I have several labels on the form so I can watch the progress of the tickCount. There is also a text box for entering the interval (in minutes).

    This version of the code just waits the amount of time, beeps once, and then starts over again.

    Hope it helps.


    Option Explicit
    Private Declare Function GetTickCount Lib "kernel32" () As Long
    Dim EndTime As Long
    Dim intMinutes As Integer

    Private Sub Command1_Click()
    intMinutes = Text1.Text
    EndTime = GetTickCount + (intMinutes * 60000)
    Label2.Caption = GetTickCount
    Label3.Caption = EndTime
    Label4.Caption = Time
    Label5.Caption = DateAdd("n", intMinutes, Time)
    Do While EndTime > GetTickCount
    Label1.Caption = GetTickCount
    DoEvents
    Loop
    timerDone
    End Sub

    Private Sub timerDone()
    Beep
    Call Command1_Click
    End Sub

    Private Sub Command2_Click()
    Unload Me
    End Sub

    Private Sub Form_Unload(Cancel As Integer)
    End
    End Sub


    [Edited by jbart on 08-28-2000 at 12:05 PM]

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