OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
From: ArunKumar S (akumarOMNESYSINDIA.COM)
Date: Tue Jan 29 2002 - 23:34:58 CST

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

    Theres another trick that could wrk - gurus here please correct me if iam
    missing anything

    If ur STA dlls are actually going to run somewhere else eg in a remote MTS
    machine (ALWAYS)- u would be naturally only having to talk to the proxies
    naturally in which case u could do something else (it is WORKING for me)

    modify th regsitartions in of the dll in the machine in which ur process is
    going to
    run and set the dlls to be - threading = Free and set the location of the
    dll in
    the inproc32s default key to be empty

    Use coinitializeEx and initilize to COINIT_MULTITHREADED -

    Now make sure u never call any of those interface pointers simultaneously

    - if u can ensure all this - then all ur proxies will be created in a single
    mta
    apartment (only for a single process) - which means that u can freely share
    the data that is returned from any of those method calls between ur differnt
    threads or whatever -

    and no need to do any marshalling of the data - can easily PostthreadMessage
    to send the data anywhere u like

    i have an exactly - similar situation - and i have touse PostthreadMessage
    too
    to send the data generated to differnt threads for execution -

    good luck
    arun

    NOTE - u will not be having STAs and its message ques in this case - and
    the PostthreadMessage i talked abt is used to sent message to threads
    created
    by u - not any STA message windows etc

    ----- Original Message -----
    From: Petter Nilsen, Technical Manager 8368 <Petter.NilsenVISMA.NO>
    To: <DCOMDISCUSS.MICROSOFT.COM>
    Sent: Tuesday, January 29, 2002 9:26 PM
    Subject: Re: Passing a safearray across apartments.

    > PostThreadMessage() returns without waiting for the message to be
    delivered,
    > so if you free the safearray just after posting it, the STA receiving the
    > message will receive already freed memory. I suggest you let the STA free
    > the memory, if possible.
    >
    > --
    > Petter Nilsen, pnirubicon.no
    > Technical Manager, Internet Development,
    > Visma Software ASA
    >
    > > -----Original Message-----
    > > From: Paul Bockisch [mailto:PaulBockischFLA-WHQ.COM]
    > > Sent: 29. januar 2002 16:32
    > > To: DCOMDISCUSS.MICROSOFT.COM
    > > Subject: Re: Passing a safearray across apartments.
    > >
    > >
    > > My safearray contains an array of bytes. I look at my
    > > safearray before I
    > > call PostThreadMessage and the data looks fine. However,
    > > when I get it in
    > > my STA, the pvData pointer is NULL. I can't figure out what I'm doing
    > > wrong.
    > >
    > > Paul Bockisch
    > > paulbockischfla-whq.com
    > >
    > >
    > >
    > > Phil Reynolds
    > > <preynoldsRIDGEWAYSY To:
    > > DCOMDISCUSS.MICROSOFT.COM
    > > STEMS.COM> cc:
    > > (bcc: Paul Bockisch/Firelite/Pittway)
    > > Sent by: Distributed Subject:
    > > Re: Passing a safearray across apartments.
    > > COM-Based Code
    > > <DCOMDISCUSS.MICROSO
    > > FT.COM>
    > >
    > >
    > > 01/29/2002 10:24 AM
    > > Please respond to
    > > Distributed COM-Based
    > > Code
    > >
    > >
    > >
    > >
    > >
    > >
    > > You only *have* to marshal interface pointers from one thread
    > > to another...
    > > so unless your safearray contains interfaces, you don't have
    > > to marshal it.
    > >
    > > ---------------------------------------------------------
    > > Phil Reynolds
    > > Ridgeway Systems and Software
    > > Tel: +44 118 938 1211
    > > Fax: +44 118 935 4444
    > > mailto:preynoldsridgewaysystems.com
    > > http://www.ridgewaysystems.com
    > >
    > >
    > > > -----Original Message-----
    > > > From: Paul Bockisch [mailto:PaulBockischFLA-WHQ.COM]
    > > > Sent: 29 January 2002 15:11
    > > > To: DCOMDISCUSS.MICROSOFT.COM
    > > > Subject: [DCOM] Passing a safearray across apartments.
    > > >
    > > >
    > > > Hi all,
    > > > I've created an STA and I want to pass it a safearray using
    > > > PostThreadMessage. I know I have to marshal the data in the
    > > > safearray in
    > > > order to pass it to the STA but I'm not sure how. I would
    > > > appreciate any
    > > > help on this.
    > > >
    > > > Paul Bockisch
    > > > paulbockischfla-whq.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
    > >
    >
    > ----------------------------------------------------------------
    > 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