473,320 Members | 2,054 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

settimer

Hi!The api funtion "settimer" is all right used in windows xp/2003
server,but it will cause a conflict when it is used in windows nt 4.0
My code(vba) as following:
////////////////////////////////////////
Declare Function SetTimer Lib "user32" (ByVal hwnd As Long, ByVal nIDEvent
As Long, ByVal uElapse As Long, ByVal lpTimerFunc As Long) As Long
Declare Function KillTimer Lib "user32" (ByVal hwnd As Long, ByVal nIDEvent
As Long) As Long
Public Id_Timer As Long
Public Sub StarTimer()
Id_Timer = SetTimer(0, Id_Timer, 1000, AddressOf timeProc)

End Sub
Public Sub timeProc()

Application.StatusBar = Now
End Sub

//////////////////////////////////////////////

Thanks.
Agan

Nov 20 '05 #1
2 5308
Cor
Hi Ligi,

I am not sure of it, but did you know this is a VB.net language group.
That is a program language quit different from VBA and with that there is no
need to use a timer in the way you do. When you are not using that VB.net
compiler, you don't have anything from what we are telling here.

When you using VB.net tell us, than we give you some alternatives.

OK?

Cor
"> Hi!The api funtion "settimer" is all right used in windows xp/2003
server,but it will cause a conflict when it is used in windows nt 4.0
My code(vba) as following:
////////////////////////////////////////
Declare Function SetTimer Lib "user32" (ByVal hwnd As Long, ByVal nIDEvent
As Long, ByVal uElapse As Long, ByVal lpTimerFunc As Long) As Long
Declare Function KillTimer Lib "user32" (ByVal hwnd As Long, ByVal nIDEvent As Long) As Long
Public Id_Timer As Long
Public Sub StarTimer()
Id_Timer = SetTimer(0, Id_Timer, 1000, AddressOf timeProc)

End Sub
Public Sub timeProc()

Application.StatusBar = Now
End Sub

Nov 20 '05 #2
* "ligi168" <li*****@163.com> scripsit:
Hi!The api funtion "settimer" is all right used in windows xp/2003
server,but it will cause a conflict when it is used in windows nt 4.0
My code(vba) as following:
////////////////////////////////////////
Declare Function SetTimer Lib "user32" (ByVal hwnd As Long, ByVal nIDEvent
As Long, ByVal uElapse As Long, ByVal lpTimerFunc As Long) As Long
Declare Function KillTimer Lib "user32" (ByVal hwnd As Long, ByVal nIDEvent
As Long) As Long
Public Id_Timer As Long
Public Sub StarTimer()
Id_Timer = SetTimer(0, Id_Timer, 1000, AddressOf timeProc)

End Sub
Public Sub timeProc()

Application.StatusBar = Now
End Sub


This is a VB.NET group. You will more likely to get an answer if you
post to this group: microsoft.public.vb.winapi.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>

<http://www.plig.net/nnq/nquote.html>
Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: ligi168 | last post by:
Hi!The api funtion "settimer" is all right used in windows xp/2003 server,but it will cause a conflict when it is used in windows nt 4.0 My code(vba) as following:...
18
by: Alan Z. Scharf | last post by:
1. I have a chain of six asynch callbacks initiated by a button, and want the page to refresh at the end of each callback to display A. Results of a SQLServer query showing cumulative running...
15
by: Tanzim Saqib | last post by:
I've been trying to learn VB.NET. I know VB6. I can not convert the following VB6 code segment to VB.NET In VB 6: ' In a module starts here: Public Declare Function SetTimer Lib "user32"...
1
by: CES | last post by:
All, I have absolutely no clue as to what the difference is between these two snippets but the on that is hard coded works and the other doesn't. I know it's something incredible stupid that I...
8
by: CES | last post by:
All, I'm sorry but I still don't get this!! I'm trying to use a variable that is passed into a function to to dynamically name an instance of an Object(). I've created a Timer() Object that seems...
6
by: Michael C | last post by:
I've created a timer object and set it running without keeping a reference to it and not stopping it. Shouldn't the garbage collector pick up that there's no reference to the timer, call finalize...
1
by: fabioscime | last post by:
Hi, I'm writing a background timer using /cc++/thread.h. this is my source code: timer.h ----------------------------------------------- #ifndef TIMER_H #define TIMER_H #include...
5
by: RomeoPapacy | last post by:
I'm currently writing a replacement shell and am suffering from quite dire memory leaks, when running, every time I roll my mouse over the taskbar icon a new window scrolls out revealing the window's...
0
by: tvnaidu | last post by:
I am looking for windows SetTimer equivalent routine in Linux, need to port this line to Linux from Windows. watchdog_timer_id=SetTimer(NULL, 0, 60000, (TIMERPROC)TimerProc);
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.