读书人

VB精密定时器的有关问题

发布时间: 2012-01-30 21:15:58 作者: rapoo

VB精密定时器的问题:
参照网友的一段代码,使用winmm.dll做精密定时,在VB6 IDE中可以正常运行,生成EXE之后运行出错,而且没有任何提示。咋办?

VB code
'共3个文件:'控件工程:mduMMTimer.bas:'控件工程:MMTimer.ctl:'测试工程:frmTest.frm'控件工程:mduMMTimer.bas: Option Explicit    Public Declare Function timeSetEvent Lib "winmm.dll" _          (ByVal dwInterval As Long, ByVal dwPrecision As Long, _          ByVal TimeProcAddr As Long, ByVal dwUserData As Long, _          ByVal fuEvent As Long) As Long  Public Declare Function timeKillEvent Lib "winmm.dll" _          (ByVal TimerID As Long) As Long      '/*   flags   for   fuEvent   parameter   of   timeSetEvent()   function   */  Public Const TIME_ONESHOT = &H0           '/*program   timer   for   single   event*/  Public Const TIME_PERIODIC = &H1           '/*program   for   continuous   periodic   event*/      Private Declare Sub CopyMem Lib "kernel32" Alias _            "RtlMoveMemory" (pDest As Any, pSource As Any, ByVal ByteLen As Long)


[解决办法]
http://www.m5home.com/blog/article.asp?id=22

看看这个会不会出错.

读书人网 >VB

热点推荐