OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
From: Wallis Simon (simon.wallis_at_DANFOSS.COM)
Date: Mon Feb 03 2003 - 05:16:16 CST

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

    This sounds very similar, but is not identical.
    My server and DLL are both ATL only (no MFC).
    My client is MFC + ATL, and it appears to be MFC code that shows up the
    problem, but is not the root cause.
    AfxOleInit sets up a ticker which periodically calls AfxOleTermOrFreeLib
    which calls CoFreeUnusedLibraries which calls DllCanUnloadNow. After about
    15 minutes, DllCanUnloadNow returns S_FALSE and the proxy gets unloaded.
    (The debug output window says the DLL is unloaded, but I assume it means the
    proxy.) After this, ANY interface method call is invalid.
    So my root problem would seem to be why my lock count is zero which causes
    DllCanUnload NOw to return S_FALSE. So I don't think it's exactly the same
    as your problem, though it sounds very similar.

    Regards,
    Simon

    > -----Original Message-----
    > From: Black Johnny [mailto:blackSW.RO]
    > Sent: 31 January 2003 06:47
    > To: DCOMDISCUSS.MICROSOFT.COM
    > Subject: Re: Spontaneous DLL unloading
    >
    >
    > Hi,
    >
    > I have the same problem in my application. Till now I have
    > found that this
    > combination caused my problem:
    >
    > - ATL project with MFC support
    > - merged proxy/stub
    > - the module implementation - CAtlDllModuleT
    >
    > If I use MFC project with ATL support everything is ok.
    >
    > This malfunction appears in multithreading context (the
    > client is a MMC
    > snapin)
    >
    > My client also has a valid interface at the beginning but if
    > I leave it
    > idle for a few minutes all the future QueryInterfaces will
    > fail with an
    > Access Violation because somehow the proxy is released (the interface
    > remains valid for interface method calls but not for
    > QueryInterface calls)
    >
    > Do you have a similar combination in your application?
    >
    > Best regards
    > Black Johnny
    >
    > ----------------------------------------------------------------
    > 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