I saw 3 sample codes for a service, which use
int main(...)
as a starting function for a service.
And I saw one sample code which uses MFC.
But I couldn't find any sample code which uses
int APIENTRY WinMain(...)
as a starting function for a service.
I tried to rewrite one of the samples which uses
main(...) to WinMain(...) and everything worked fine.
My question: is which approach is the better way to write a service?
Thank you.
Здравствуйте cutecode, Вы писали:
C>I saw 3 sample codes for a service, which use
C>C>int main(...)
C>
C>as a starting function for a service.
C>And I saw one sample code which uses MFC.
C>But I couldn't find any sample code which uses
C>C>int APIENTRY WinMain(...)
C>
C>as a starting function for a service.
C>I tried to rewrite one of the samples which uses
C>main(...) to WinMain(...) and everything worked fine.
C>My question: is which approach is the better way to write a service?
From a technical perspective there is no much difference which approach to use. Some people like to debug their services as usual applications first, so they write them as console processes to see the debug output. Other people (including me) worry about resources consumed by the useless console window and write services as windowed processes.
Спасибо, Шурик!
And THANKS for all the others replies, you did for me, from CodeGuru !!!