CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 1999
    Location
    Germany
    Posts
    53

    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

  2. #2
    Guest

    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);
    }
    }


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured