OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
From: Phil Reynolds (PReynoldsRIDGEWAY-SYS.COM)
Date: Wed May 02 2001 - 03:34:29 CDT

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

    If machine A and machine B are both clients to the same server then their
    apartments are irrelevant. It is the apartment of the server that is
    important -- this is where the object lives. COM will take care (in most
    cases) of ensuring that all calls from A or B are actually marshalled and
    executed on the server's STA.

    In-proc objects change this slightly as they generally live in the client's
    apartment directly. But even then if two clients access the same object COM
    will ensure that calls to the object are made on the thread where the object
    lives (normally the one that created it).

    As with all things COM, you can break the rules and cause your self a lot of
    grief 'cos COM tries to keep out of your way as much as possible.

    > -----Original Message-----
    > From: Peter Hu [mailto:HzjAOL.COM]
    > Sent: 02 May 2001 04:22
    > To: DCOMDISCUSS.MICROSOFT.COM
    > Subject: Re: [DCOM] CoInitialize doubts
    >
    >
    > What I am asking is as follows
    > In what case, a STA object is used by multi-threads? say,
    > machine A and
    > machine B both run the same application, therefore they both
    > create, say STA
    > objects on application server, my question is: can they use
    > the same object?
    > It seems so, but if machine A 's thread call CoInitialize(),
    > machine B's also
    > call it, the STA objects created are in different
    > apartments, then how can
    > they share the same object ? I just donot understand when a
    > STA object could
    > be used by different threads.
    >
    > Thanks.
    >
    > Peter
    >

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