OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
From: Paul Bockisch (PaulBockischFLA-WHQ.COM)
Date: Mon Jan 07 2002 - 12:55:37 CST

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

    Jorge,
      I did this in Visual C++, but I imagine you could do the same thing in
    Delphi using the windows APIs. I too was creating a thread to test
    connection status. What I did was to spawn one thread and within that
    thread I called CoInitialize(NULL) to enter the STA. That thread created
    two timers. When a timer woke up, it would check the status of it's
    particular connection. If if found connectivity was disconnected, it would
    set an event object telling the app that it had been disconnected. The
    rest of the application consisted of two threads that belonged to the MTA.
    I don't know if this was the best way to do it but it worked for me.

    -Paul

                        "Jorge A.
                        Rodriguez Suarez" To: DCOMDISCUSS.MICROSOFT.COM
                        <jarsRECIFE.PE.GO cc: (bcc: Paul Bockisch/Firelite/Pittway)
                        V.BR> Subject: Re: Problem...
                        Sent by:
                        Distributed
                        COM-Based Code
                        <DCOMDISCUSS.MICR
                        OSOFT.COM>

                        01/07/2002 08:40
                        AM
                        Please respond to
                        Distributed
                        COM-Based Code

    Yes Paul, but how i can use both model and make this to work, cause i
    tested
    with both(using tmBoth in the TAutoObjectFactory.Create Method when i
    register my server), but the problem remains...

    Jorge...

    ----- Original Message -----
    From: Paul Bockisch <PaulBockischFLA-WHQ.COM>
    To: <DCOMDISCUSS.MICROSOFT.COM>
    Sent: Monday, January 07, 2002 14:55
    Subject: Re: Problem...

    > Jorge,
    > I had a similar problem. The problem is that a timer needs a message
    pump
    > in order to work. With a single threaded model, the apartment provides
    the
    > message pump. However, a multi-threaded apartment model does not. I
    > eventually had to use both models in order to get it to work.
    >
    > Paul Bockisch
    >
    >
    >
    > "Jorge A.
    > Rodriguez Suarez" To:
    DCOMDISCUSS.MICROSOFT.COM
    > <jarsRECIFE.PE.GO cc: (bcc: Paul
    Bockisch/Firelite/Pittway)
    > V.BR> Subject: Problem...
    > Sent by:
    > Distributed
    > COM-Based Code
    > <DCOMDISCUSS.MICR
    > OSOFT.COM>
    >
    >
    > 01/07/2002 07:17
    > AM
    > Please respond to
    > Distributed
    > COM-Based Code
    >
    >
    >
    >
    >
    >
    > Hello all:
    >
    > I have a Problem, and i think is with the Threading model of my server.
    >
    > I have a server DCOM that use multi-threaded apartment like Threading
    > Model,
    > because is what i need. My server have a timer( is a Delphi component,
    > cause
    > my server is wrote in delphi ) that each minute call a method to check if
    a
    > client is connected, so when i before used apartment it worked, but when
    i
    > change to multi-apartment, the problem began, there is no more call to
    that
    > method by the server...
    >
    > what can this be?...thanks
    >
    > Jorge...
    >
    > ----------------------------------------------------------------
    > 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
    >
    > ----------------------------------------------------------------
    > 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

    ----------------------------------------------------------------
    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

    ----------------------------------------------------------------
    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