OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
From: Fareeduddin A. Mohammed (fareedSIGMATEL.COM)
Date: Thu Aug 30 2001 - 19:23:31 CDT

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

    Brian,

    I didn't get that. I did checked for apartment-threaded when I created this
    using atl object wizard.

    -Fareed.

    -----Original Message-----
    From: Distributed COM-Based Code [mailto:DCOMDISCUSS.MICROSOFT.COM]On
    Behalf Of Brian Muth
    Sent: Thursday, August 30, 2001 4:10 PM
    To: DCOMDISCUSS.MICROSOFT.COM
    Subject: Re: atl module single instance.

    >
    > Thanks for replying. The requirement is that the object should be able
    to
    > work with a kernel mode driver, handle of which is created using
    > CreateFile
    > API. This API will fail if the driver handle is already created and is
    > still
    > open by some other object or app. Now, if I somehow able to connect to
    the
    > running object that is serving either local or remote client, then
    there
    > is
    > no need to create another instance hence I can avoid this problem.
    >

    Most experienced DCOM programmers would advise against your approach in
    favor of sharing the driver handle as a static member variable, and
    protecting it using some kind of synchronization.

    For example, why not just mark your object as apartment-threaded. Then
    your method calls will automatically be serialized.

    HTH,
    Brian

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