title: Windows Service written in D7, cannot be run under WinServer2008 64 bit after restart
body: <p>I have written a post several months ago regarding the problem I have been fighting with.
  Here was the link:</p>
  
  <p><a href="https://stackoverflow.com/questions/8148853/0x0eedfade-kernelbase-dll-faulting-module-in-d7-windows-service">0x0eedfade kernelbase.dll faulting module in d7 windows service</a></p>
  
  <p>Generally the problem is that the Windows service written in D7 for the first time starts ok and works perfectly but in the time when I have to restart it (e.g. after several days) , I cannot do it.</p>
  
  <p>Today I have included madexcept to the executable and I got during startup:</p>
  
  <pre><code>compiled with     : Delphi 7
  madExcept version : 3.0l
  callstack crc     : $dbabc0aa, $f5cfd533, $f5cfd533
  exception number  : 1
  exception class   : EOutOfResources
  exception message : Error creating window class.
  
  main thread ($c88):
  004a7419 +09d ServiceTest.exe Forms                  6322 +20 TApplication.CreateHandle
  004a7206 +1a6 ServiceTest.exe Forms                  6250 +32 TApplication.Create
  00493fc3 +10b ServiceTest.exe Controls              10924 +10 InitControls
  0049411b +02f ServiceTest.exe Controls              10943  +2 initialization
  004048c0 +044 ServiceTest.exe System                          InitUnits
  00404926 +03a ServiceTest.exe System                          @StartExe
  00407392 +03a ServiceTest.exe SysInit                         @InitExe
  004ed991 +011 ServiceTest.exe ServiceTest    62  +0 initialization
  75f13675 +010 kernel32.dll                                              
  </code></pre>
  
  <p>Well as far as I remember it doesn't even go to begin end section of the project file.
  I am just curious whether the system is running out of resources but:
  system handles are on the good level, memory as well.</p>
  
  <p>Any suggestion what still Can i do?</p>
  
  <p>I cannot restart the production sever everytime I get this error and cannot restart the application.</p>