Einzelnen Beitrag anzeigen

ZuBi

Registriert seit: 21. Jun 2005
8 Beiträge
 
#7

Re: Why Cant Start A service.

  Alt 30. Jun 2005, 01:12
Zitat von Olli:
Zitat von ZuBi:
i quite sure the problem is in there, there for i debug it

Delphi-Quellcode:
FillChar(DispatchTable, SizeOf(DispatchTable), 0);
DispatchTable[0].lpServiceName:= PChar(S_Name);
DispatchTable[0].lpServiceProc:= @ServiceProc;
If not StartServiceCtrlDispatcher(DispatchTable[0]) Then AddToMessageLog('StartServiceCtrlDispatcher error');
Straight from this code there's no obvious mistake!

Zitat von ZuBi:
Log:
Code:
[16:02:13] StartServiceCtrlDispatcher error
its seems its not passing this so the problem comes from there, i tryed to see if its somthing with ServiceProc but when i put there a log, its ont wrting anything so its not getting to there,
So control is not passed to the SCM?

Zitat von ZuBi:
i am trying to implent service in a dll( is it other method ? ).
I doubt that will work, since DLLs and PE/EXE files share only the structure but differ by many flags. The SCM was made to get control over an EXE file, not a DLL.

Zitat von ZuBi:
i know its to know the problem from this few lines i have posted, there for i will post all soon.

Ps: It seems it cant register the proc (@ServiceProc) so it cant find the procedure, i dont know why.
Could you please add a GetLastError() after the IF-condition and tell us the error code?! There must be one.
hello, the problem comes when trying to implent dll as service, it is possible and works at C. the SCM can control dll, as micrsoft doind it with loaders (svchost), there is no dubet the error comes when trying to reg the procedure, if i covert it to exe it works like it shuold, seince it dll and delphi doesnt speak with win like c, i tryd using stcall to make it like c, since nobody if its really works, its not. and i still cant make it as a service. the problem its possible becouse same thing works with c code posted artclie i saw some where. now can u sper few min and try slove it ? with code. u dont need alot just proc for install then to reg it(StartServiceCtrlDispatcher). if u want my codes let me know.
  Mit Zitat antworten Zitat