Hi all
I have a page (runmodal = false) with a timer AddIn (freddy's) on it.
The timer triggers every second:
OnControlAddIn(Index : Integer;Data : BigText)
Everything works fine, except when I change the company or the language of the RTC.
RTC then restarts the Pages but the timer event gets raised:
this.RaiseControlAddInEvent((int)TimerFunctions.Counter, this.count++.ToString());
this causes a Null Reference Exception and the RTC throws this error:
Microsoft Dynamics NAV
Page is not open.
OK
Which is true... but how can I avoid this situation?
Comments
maybe you need to do this too
EDIT: I took a look at his code (freddys) and found that he implements dispose ... :-k
EDIT2: What is TimerFunctions? I don't find this one in freddys code (here: http://blogs.msdn.com/b/freddyk/archive/2009/11/03/timer-events-on-a-page.aspx)
Counter = 1
basically the same like:
this.RaiseControlAddInEvent(1, this.count++.ToString());
...
Application.EnterThreadModal
Application.LeaveThreadModal
..stuff because I need the events ALWAYS fired.
Freddy's example doesn't fire events when you have a modal form open