VB的怎么在VC出现?
参考SDK api 的 SetTime,(其实类似VB里的定时器控件)
不过精度最高只到1ms要再高,参考下面这个贴子:
http://www.csdn.net/expert/topic/749/749290.xml?temp=5.369204E-02
把它用到VB里去。不过VB的控件丰富,应该找得到现成的高精度定时器控件。Good luck.
参考SDK api 的 SetTime,(其实类似VB里的定时器控件)
不过精度最高只到1ms要再高,参考下面这个贴子:
http://www.csdn.net/expert/topic/749/749290.xml?temp=5.369204E-02
把它用到VB里去。不过VB的控件丰富,应该找得到现成的高精度定时器控件。Good luck.
http://www.csdn.net/expert/topic/749/749290.xml?temp=5.369204E-02
不行,vb中嵌不了汇编和_int。
同样谢谢。10分!
在form中
Private Sub Command1_Click()
If timeBeginPeriod(1) = 0 Then
lngReturn = timeSetEvent(1, 0, AddressOf timeSetEventProc, 1, 1)
End If
End Sub
Private Sub Command2_Click()
timeEndPeriod (1)
timeKillEvent lngReturn
End SubPrivate Sub Form_Load()
js = 0
End SubPrivate Sub Form_Unload(Cancel As Integer)
Command2_Click
End Sub
在模块中
Public Declare Function timeBeginPeriod Lib "winmm.dll" (ByVal uPeriod As Long) As Long
Public Declare Function timeSetEvent Lib "winmm.dll" (ByVal uDelay As Long, ByVal uResolution As Long, ByVal lpFunction As Any, ByVal dwUser As Long, ByVal uFlags As Long) As Long
Public Declare Function timeKillEvent Lib "winmm.dll" (ByVal uID As Long) As Long
Public Declare Function timeEndPeriod Lib "winmm.dll" (ByVal uPeriod As Long) As Long
Public lngReturn As Long
Public js As LongPublic Sub timeSetEventProc(ByVal uID As Long, ByVal uMsg As Long, ByVal dwUser As Long, ByVal dw1 As Long, ByVal dw2 As Long)
js = js + 1
Form1.Text1 = js
If js = 1000 Then st
End SubSub st()
timeEndPeriod (1)
timeKillEvent lngReturn
Form1.Text2 = "jsdgf"
End Sub
我给你分结账后,我的分少了88分,但你的得分没有显示,不知你得到没有?
知道为什么吗?
我仅剩192分,不敢再试。