borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (reload settings)Next Topic (EM_SETTEXTMODE not working) New Topic New Poll Post Reply
AndreaVB Forum : API : using timegettime api in VB
Poster Message
vivek_g27
Level: Sage

Registered: 06-04-2005
Posts: 57

icon using timegettime api in VB

hi,

how do i use timegettime() api in VB.

I declared the api. Then the api started giving negative values.

since the application iam trying to develop will run continuously for months together.

How do i initialize the timer

How do i set the time delay

How do i restart the timer.

i am trying to use the timer to send the data to COM port. (to wait while transmitting)

Then i will use the api to (to wait and) receive data from COM port.

Any help in understanding the timegettime function and any example (if possible) will be greatly appreiciated.

regards,
vivek

24-12-2005 at 10:23 AM
View Profile Send Email to User Show All Posts | Quote Reply
steve_w
Level: Moderator


Registered: 18-04-2003
Posts: 1156
icon Re: using timegettime api in VB

Found this if its any help

http://www.trap17.com/index.php/api-timegettime_t9092.html


It says there a bug in that function. You could also use the sleep api, I use it in serial comms when I need to put a delay before reading the port.



Steve  

06-01-2006 at 02:38 PM
View Profile Send Email to User Show All Posts | Quote Reply
Goran
Level: Moderator

Registered: 16-05-2002
Posts: 1681
icon Re: using timegettime api in VB

When I needed to know the elapsed time, I used GetTickCount API. It is quite easy for use:

Private Declare Function GetTickCount& Lib "kernel32" ()

dim retval as long

    retval = GetTickCount()
    ' some coding
    ' .....................
    MsgBox (GetTickCount -retval) & " miliseconds elapsed"


____________________________
If you find the answer helpful, please mark this topic as solved.

21-01-2006 at 02:21 AM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : API : using timegettime api in VB
Previous Topic (reload settings)Next Topic (EM_SETTEXTMODE not working) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder