delphi - Unexpected calling of form destroy -


I have a service on the customer and in particular I have seen a strange behavior always before the service is stopped, After entering the farm Dustroy, shutting down routine (onstop) is executed. However, in this customer, the service has been unexpectedly terminated (I know because Formusthost is calling), but without entering the service shutdown routine.

By looking at the stack, everything is normal:

 01388f14 ****. Exe Main **** 32766 TF **** FormDestroy 00506cbd ****. Exe form TCustomForm.DoDestroy 00506b23 ****. Exe Form TCustomForm.BeforeDestruction 00404c95 ****. Exe system @BeforeDestruction 007a6a02 ****. Exe dxRibbonForm 445 TdxCustomRibbonForm .Destroy 00487eaa ****. Exe Classes TComponent.DestroyComponents 00504a33 ****. Exe form DoneApplication 0045da9d **** Exe SysUtils DoExitProc ******************************** Exe system @ halt0 01,435,465 **** Exe main * *** 289 initialization 75,773,388 kernel32.dll BaseThreadInitThunk 

I can see this message in the Windows Event Viewer:

Details for event ID 0 from source *** Can not be found. Either component that raises this phenomenon is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.

If the event has originated from another computer, the display information was to be saved with the event.

The following information was included with the event:

The extended handler is registered

Can you signal me to find out that What is happening? The message is meaningless in

event viewer . This is the standard error lesson for only one event, where the source of the incident, which has not provided a DLL containing a suitable error message to describe a particular event.

Since your service attempts to run with interaction (with an UI), you probably set the interactive property of your service on TRUE is. This means that your service starts with the SERVICE_INTERACTIVE_PROCESS flag set service can be prevented from running by the system, based on the installation of a system with this flag, the system started. In the summary

key in the HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Control \ Windows registry, if NoInteractiveServices value 1 (zero ), Such services have been stopped from running in the case of a Delphi implemented service, that means that the service process has started, but when this service is the same, resulting in causing a problem in your UI destruction code May be if it is included in the assumptions The initialisation of your service UI was successful that attempts to sterger will end.

On your affected client system, change this registry value from 0 (zero) to Allow interactive services. Your service then is able to start confirming that this is the source of your problem.

However, its customers have been specifically chosen for such services (for the reason that the article has not been allowed to see the note in the article) for valid reasons.

If this is the case and it is actually the cause of your problem, then they will be forced to find an alternative approach to the UI requirements of your service / application. In the meantime, if your use of service is important to that customer, then it can provide a temporary solution, if they make necessary changes to your system architecture, for a limited time while preparing to enable this setting on the affected system Are there.


Comments