Click to See Complete Forum and Search --> : NTService and CAyncsocket


Karsten Döring
March 31st, 1999, 05:52 AM
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

April 8th, 1999, 04:43 PM
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);
}
}