I run a NotesTimer on client. It will scan my mailbox per 15mins,if find new mail,it will invoke a dll,popup a window.code shows as below.
Everything work fine,but if I open a Notes dialogbox,at the same time,NotesTimer popup the alert window,system will halt.
Because when I open a Notes dialogbox,then NotesTimer scan my mailbox,the action don’t be executed until I confirm the Notes dialogbox.Notes dialogbox conflict with mail scanning.
The popup window is a realmode window,because Notes don’t support un-realmode window.
Set MinderTimer = New NotesTimer(900) '900s
On Event Alarm From MinderTimer Call MinderTimerHandler
End Sub
Sub MinderTimerHandler(Source As NotesTimer)
Dim obj As Variant
Dim resp As String
'txt and url are got from mailbox realtime.
'DisplayAlert will popup a alert window(Windows' window)
Set obj = CreateObject("Popup.DisplayMsg")
resp=obj.DisplayAlert(txt,url,3000,101)
Please don’t put “Urgent” in your subject line. See the forum etiquette guidelines.
You’re trying to program functionality which is already part of Notes. Why don’t you just turn on new mail popup in the Mail tab of your user preferences?
If you do need to do something like this, though, here are a couple of ideas:
I haven’t heard of this Popup.DisplayMsg class – perhaps the problem is that you just need to use a different class, e.g. WScript.Shell (with the Popup method).
You can also display a message in LotusScript using the Messagebox statement, which does not limit your application to the Windows operating system. Of course, this would be a modal dialog.
If you do display a modal dialog, or do anything else that might make the timer event procedure not end before the next timer tick, you must disable the timer inside the event procedure, and re-enable it when you exit. Otherwise, Notes will probably crash when a second timer event occurs while the first is still processing.