Results 1 to 19 of 19

Thread: [RESOLVED] Timer control

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2007
    Posts
    278

    Resolved [RESOLVED] Timer control

    Maybe someone can tell me for which control library file belong Timer ?

  2. #2
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: Timer control

    Msvbvm60.dll

  3. #3
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: Timer control

    Quote Originally Posted by Lauriux1
    Maybe someone can tell me for which control library file belong Timer ?
    Timer is one of the intrisic controls (also there is a built-in Timer function) so what difference would it make to know the library name?

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    May 2007
    Posts
    278

    Re: Timer control

    I guess that Msvbvm60.dll is not defoult Windows XP file ? I'm right ?

  5. #5
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Timer control

    Quote Originally Posted by Lauriux1
    I guess that Msvbvm60.dll is not defoult Windows XP file ? I'm right ?
    No, but it is a default VB6 file that should have gotten installed when you installed the software. Did you install VB6 from a legal, manufacturer's disc?

  6. #6
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: Timer control

    Quote Originally Posted by Lauriux1
    I guess that Msvbvm60.dll is not defoult Windows XP file ? I'm right ?
    According to MS VB runtime files are distributed with every post Win98 OS.
    However, it might not come with developer's license so as Hack said if you want to develop in VB (any version) you must install it from legal media.

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    May 2007
    Posts
    278

    Re: Timer control

    Yes I know that!
    I just want to know is there a big chance that people who will use my program will get an error like "Missing Msvbvm60.dll"
    Or Msvbvm60.dll file is in all Windows XP by defoult???

  8. #8
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Timer control

    It should be included in the setup and installation package that you create when you roll your app out.

  9. #9

    Thread Starter
    Hyperactive Member
    Join Date
    May 2007
    Posts
    278

    Re: Timer control

    Maybe someone can recommend an good code based timer (short code) ?

  10. #10
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: Timer control

    See post #41 here, but as Hack suggested you really should create an installation package. You are only asking for trouble otherwise. Is there some reason you don't want to create an installation package?

  11. #11

    Thread Starter
    Hyperactive Member
    Join Date
    May 2007
    Posts
    278

    Re: Timer control

    Quote Originally Posted by MartinLiss
    See post #41
    Post #14 not #41

    Quote Originally Posted by MartinLiss
    Is there some reason you don't want to create an installation package?
    Yes I can put Msvbvm60.dll to resources of my program but I already have MSCOMCTL.OCX, TABCTL32.OCX, COMDLG32.OCX there and I don't want make it more heavy than it is now.

    Quote Originally Posted by MartinLiss
    You are only asking for trouble otherwise.
    I just want to make an delay function and for some reasons I don't want use Sleep API, that’s why I need a timer.
    But if someone have some ideas how to make an delay function without timer then please post this ideas here.

  12. #12

  13. #13

    Thread Starter
    Hyperactive Member
    Join Date
    May 2007
    Posts
    278

    Re: Timer control

    Thanks MartinLiss

    But what is fundamental difference between:
    Code:
    Dim dClock As Double
    
        dClock = Timer
        While Timer < dclock + 1 ' "Wait" 1 second
            DoEvents
        Wend
    and
    Code:
    Dim Start As Long
    
        Start = Timer
        Do While Timer < Start + 1 ' "Wait" 1 second
            DoEvents
        Loop

  14. #14
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: Timer control

    Using a Long rather than a Double limits you to whole numbers. In other words this wouldn't do what you wanted.

    Code:
    Dim Start As Long
    
        Start = Timer
        Do While Timer < Start + .5 ' "Wait" .5 second
            DoEvents
        Loop
    I should say however that Do/Loop is better then While/Wend.

  15. #15

    Thread Starter
    Hyperactive Member
    Join Date
    May 2007
    Posts
    278

    Re: Timer control

    Thanks MartinLiss for explanation

    And last question:
    What is difference between Sleep and SleepEx ?

    RESOLVED!

  16. #16
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Timer control

    To mark a thread resolved, click on Thread Tools, and click the 'Mark Thread Resolved' menu item.

  17. #17
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: Timer control

    Declare Sub Sleep Lib "kernel32" Alias "Sleep" (ByVal dwMilliseconds As Long)

    · dwMilliseconds
    Specifies the time, in milliseconds, for which to suspend execution. A value of zero causes the thread to relinquish the remainder of its time slice to any other thread of equal priority that is ready to run. If there are no other threads of equal priority ready to run, the function returns immediately, and the thread continues execution. A value of INFINITE causes an infinite delay.


    ______________________________________________________________________


    Declare Function SleepEx Lib "kernel32" Alias "SleepEx" (ByVal dwMilliseconds As Long, ByVal bAlertable As Long) As Long

    · dwMilliseconds
    Specifies the time, in milliseconds, that the delay is to occur. A value of zero causes the function to return immediately. A value of INFINITE causes an infinite delay.

    · bAlertable
    Specifies whether the function may terminate early due to an I/O completion callback function or an APC. If bAlertable is FALSE, the function does not return until the time-out period has elapsed. If an I/O completion callback occurs, the function does not return and the I/O completion function is not executed. If an APC is queued to the thread, the function does not return and the APC function is not executed.
    If bAlertable is TRUE and the thread that called this function is the same thread that called the extended I/O function (ReadFileEx or WriteFileEx), the function returns when either the time-out period has elapsed or when an I/O completion callback function occurs. If an I/O completion callback occurs, the I/O completion function is called. If an APC is queued to the thread (QueueUserAPC), the function returns when either the timer-out period has elapsed or when the APC function is called.

  18. #18
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: Timer control

    Quote Originally Posted by Lauriux1
    Yes I can put Msvbvm60.dll to resources of my program but I already have MSCOMCTL.OCX, TABCTL32.OCX, COMDLG32.OCX there and I don't want make it more heavy than it is now.
    All VB6 applications require MSVBVM60.DLL to run! It's one of the foundation files for the VB run-time, without it your application will simply not run.

  19. #19
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: [RESOLVED] Timer control

    Please before you go off in the wrong direction please read Installation Problems You will need more than just that file for your app to run.

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