NTService and CAyncsocket
Hi,
I have a problem with my NTService and using CAsyncsocket.
My service shall wait for an incoming connection. This happens :-) but when I want to accept that incoming call nothing more happens.
I have this code as MFC only and there it works very well. So what is the problem?
Thanx in advance
Re: NTService and CAyncsocket
Service is a console applicattion and it cann't process messages generated by CAsyncSocket object. So you must insert something like this in service's main function:
while(WaitForSingleObject(hStop, 100)){ //wait for stop event (stop service)
if(HIWORD(GetQueueStatus(QS_ALLEVENTS))!=0){
GetMessage(&Msg, NULL,0,0);
TranslateMessage(&Msg);
DispatchMessage(&Msg);
}
}