"main()" or "WinMain()" to write a service...?
От: cutecode  
Дата: 27.11.01 02:16
Оценка:
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.
Re: main() or WinMain to write a service...?
От: Alex Fedotov США  
Дата: 27.11.01 03:27
Оценка: 3 (1)
Здравствуйте 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.
-- Alex Fedotov
Re[2]: main() or WinMain to write a service...?
От: cutecode  
Дата: 27.11.01 04:30
Оценка:
Спасибо, Шурик!

And THANKS for all the others replies, you did for me, from CodeGuru !!!

 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.