lemonisdead Well-Known Member Licensed User Longtime User Apr 19, 2015 #1 Hello, Again I am seeing strange things : in a service, in Service_Create I have initialized a Timer While debugging, I have seen in the logs 1003: Object was already initialized Click to expand... This turns my head on because : the service was destroying itself the Timer is initialized in Service_Create only Do I have something more to learn about components life cycles ? As a workaround I now test if the Timer is already initialized. But is it the right way to do things ? Code: Copy Sub Service_Create If Not(TEnvoiSMS.IsInitialized) Then TEnvoiSMS.Initialize("TEnvoiSMS",DateTime.TicksPerSecond/4) LoadStuff End Sub Many thanks
Hello, Again I am seeing strange things : in a service, in Service_Create I have initialized a Timer While debugging, I have seen in the logs 1003: Object was already initialized Click to expand... This turns my head on because : the service was destroying itself the Timer is initialized in Service_Create only Do I have something more to learn about components life cycles ? As a workaround I now test if the Timer is already initialized. But is it the right way to do things ? Code: Copy Sub Service_Create If Not(TEnvoiSMS.IsInitialized) Then TEnvoiSMS.Initialize("TEnvoiSMS",DateTime.TicksPerSecond/4) LoadStuff End Sub Many thanks
thedesolatesoul Expert Licensed User Longtime User Apr 19, 2015 #2 The service may be destroyed but not the process. You can check IsInitialized. Upvote 0
lemonisdead Well-Known Member Licensed User Longtime User Apr 19, 2015 #3 Edit : Sorry I have got it : it is a Process Global... Thanks again for your advice Upvote 0