I have written a windows service in D7. It worked perfectly ok until today when it
doesn't want to be launch.
In event log I get the error:
Faulting application name: XServ12.exe, version: 0.0.0.0, time stamp: 0x2a425e19
Faulting module name: KERNELBASE.dll, version: 6.1.7600.16385, time stamp: 0x4a5bdbdf
Exception code: 0x0eedfade
Fault offset: 0x0000b727
Faulting process id: 0xbb4
Faulting application start time: 0x01cca43b2aee203a
I read somewhere that it maybe the problem with initialization sections of the units.
Well, I have removed almost all units form the project and left with: Sysutils, CLasses, Dialogs. When Dialogs.pas unit exists I have still the error when I remove it, the program successfully goes to begin end of the project dpr section.
Furthermore, even if I have all these 3 units and Just manually run exe it launches perfectly ok. Only an error occur when I try to run service from the System Services...
If I reboot the computer, everything is ok. ...
Any ideas?
解决方案
0x0eedfade could be an unhandled Delphi exception propagated outside of a Delphi process.
If the problem only exists when linking in the Dialogs unit it's possible that its initialization, or initialization of any unit it depends on, raises an exception which is not handled and escapes out of your Delphi process.
It could be related to the fact that a service runs in an isolated session (as described in this document) and doesn't have access to the Windows UI subsystem (station, desktop, windows) anymore. In other words, forget interactive services.