马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
- [FONT=courier new]
- Public Declare Function timeSetEvent Lib "winmm.dll" (ByVal uDelay As Long, ByVal _
- Resolution As Long, ByVal lpFunction As Long, ByVal dwUser As Long, _
- ByVal uFlags As Long) As Long
- Public Declare Function timeKillEvent Lib "winmm.dll" (ByVal uID As Long) As Long
- Public ID As Long
- Public Sub TimeProc(ByVal uID As Long, ByVal uMsg As Long, ByVal dwUser As Long, _
- ByVal dw1 As Long, ByVal dw2 As Long)
- ThisDrawing.Utility.Prompt vbCrLf & "My MSG"
- End Sub
- Public Sub StartTimerProc()
- ID = timeSetEvent(1000, 0, AddressOf TimeProc, 1, 1)
- End Sub
- Public Sub EndTimerProc()
- timeKillEvent ID
- End Sub
- [/FONT]
上面是一段VBA代码,可是,运行StartTimerProc后,CAD命令行没有任何反应,如果将ThisDrawing.Utility.Prompt vbCrLf & "My MSG"
改为Debug.print "My MSG",在立即窗口中有输出。
另外,运行后,CAD系统不稳定,经常出现崩溃。
请高手帮解释一下。 |