OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
From: SREEKALA RAMAN (skalaNESTEC.NET)
Date: Mon Jul 23 2001 - 23:47:04 CDT

  • Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

    Hi Anuradha,
    When you create an ATL COM exe server ( I am guessing you are
    creating a NT service), ATL COM generates the following code for you..

    inline void CServiceModule::Handler(DWORD dwOpcode)
    {
    switch (dwOpcode)
       {
    case SERVICE_CONTROL_STOP:
       SetServiceStatus(SERVICE_STOP_PENDING);
          PostThreadMessage(dwThreadID, WM_QUIT, 0, 0);
          break;
       case SERVICE_CONTROL_PAUSE:
          break;
       case SERVICE_CONTROL_CONTINUE:
          break;
       case SERVICE_CONTROL_INTERROGATE:
          break;
       case SERVICE_CONTROL_SHUTDOWN:
          break;
       default:
          LogEvent(_T("Bad service request"));
       }
    }

    In the SERVICE_CONTROL_SHUTDOWN case , you can send messages to the clients.
    Unless I am missing some points in your questions, I think this should
    work..

    Kala

    -----Original Message-----
    From: anuradha pillai [mailto:anuradhapillaiYAHOO.COM]
    Sent: Monday, July 23, 2001 6:51 PM
    To: DCOMDISCUSS.MICROSOFT.COM
    Subject: Re: server shutdown event.

    hi Kala,

    Thanks for replying.. I have the folowing doubts.
    Would be grateful for any guidance.

    I thought I could fire a Disconnect event (which I
    normally fire when any client disconnects.. to inform
    all other clients that this client has disconnected)
    The problem is that I dunno where I would get the
    shutdown event from windows...
    Is there a way where I could fire this event
    'Fire_OnDisconnect()' before the class object is
    destroyed...

    I have a ATL COM exe server (singleton).
    In the winmain, shouldn't a loop like the following
    work ? ->
    while (GetMessage(&msg, 0, 0, 0))
    {
    if (msg.message == WM_QUERYENDSESSION) //or WM_CLOSE
       MessageBox(NULL, "gotcha", "ChatServer", MB_OK);
    DispatchMessage(&msg);
    }
    Please correct me if I am wrong ..

    Regards,
    Anu.

    --- SREEKALA RAMAN <skalaNESTEC.NET> wrote:
    > Hello Anu,
    >
    > You could use the event sink mechanism to get the
    > messages back to the
    > client.
    > There are some examples of how this is done in the
    > MSDN library.
    >
    > Kala
    >
    > -----Original Message-----
    > From: anuradha pillai
    > [mailto:anuradhapillaiYAHOO.COM]
    > Sent: Monday, July 23, 2001 2:59 PM
    > To: DCOMDISCUSS.MICROSOFT.COM
    > Subject: server shutdown event.
    >
    >
    > hi all,
    > sorry if I'm repeating questions here...
    > but I couldn't find a satisfactory reply to this in
    > the archives...
    >
    > I'm a newbie trying to implement a chat
    > client/server
    > using ATL for server and VB for client (on NT4) ..
    > suppose I shutdown the server using task mgr , I
    > want
    > the server to notify all the clients of the event
    > that, server is shutting down...
    > i don't understand how to go about doing this..
    >
    > Can someone please help. Any help, pointer to
    > articles
    > ,etc will be appreciated.
    > Regards,
    > Anu.
    >
    >
    > __________________________________________________
    > Do You Yahoo!?
    > Make international calls for as low as $.04/minute
    > with Yahoo! Messenger
    > http://phonecard.yahoo.com/
    >
    >
    ----------------------------------------------------------------
    > Users Guide
    >
    http://msdn.microsoft.com/workshop/essentials/mail.asp
    > contains important info. Save time, search the
    > archives at
    > http://discuss.microsoft.com/archives/index.html .
    > To unsubscribe,
    > mailto:DCOM-signoff-requestDISCUSS.MICROSOFT.COM
    >
    >
    ----------------------------------------------------------------
    > Users Guide
    >
    http://msdn.microsoft.com/workshop/essentials/mail.asp
    > contains important info. Save time, search the
    > archives at
    > http://discuss.microsoft.com/archives/index.html .
    > To unsubscribe,
    mailto:DCOM-signoff-requestDISCUSS.MICROSOFT.COM

    __________________________________________________
    Do You Yahoo!?
    Make international calls for as low as $.04/minute with Yahoo! Messenger
    http://phonecard.yahoo.com/

    ----------------------------------------------------------------
    Users Guide http://msdn.microsoft.com/workshop/essentials/mail.asp
    contains important info. Save time, search the archives at
    http://discuss.microsoft.com/archives/index.html .
    To unsubscribe, mailto:DCOM-signoff-requestDISCUSS.MICROSOFT.COM

    ----------------------------------------------------------------
    Users Guide http://discuss.microsoft.com/archives/mailfaq.asp
    contains important info. Save time, search the archives at
    http://discuss.microsoft.com/archives/index.html .
    To unsubscribe, mailto:DCOM-signoff-requestDISCUSS.MICROSOFT.COM