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.