Article View: borland.public.cppbuilder.nativeapi
Article #3920Re: How to find if a DLL is still loaded
From: David Pratt
Date: Sun, 16 Apr 2006 05:30
Date: Sun, 16 Apr 2006 05:30
25 lines
2180 bytes
2180 bytes
"David" <davids@unite.com.au> wrote in message news:443c5e6a@newsgroups.borland.com... >> I still don't understand what David (the op) is trying to achieve. > > The DLL sends messages to my app but I don't send messages back. If the > user exits the app then I would like to warn the user that there is still > a DLL trying to communicate with it before the user exits. Therefore I > need to know if the DLL is still in use. > > Actually I do have access to source code for the DLL so maybe I could do > something from the DLL end. I asked here once whether or not you could > send messages to a DLL and it wasn't a simple proposition either. > > regards > david > Check this out: Since you are already considering re-writing code for the DLL, the DLLMain or DLL EntryPoint (Depends on whether you've selected MFC Compatability or not) function takes as one of its parameters a reason code, of which one of the valid reason codes for the function to be called is "DLL_PROCESS_DETACH". I would think you could use this to trap detach calls from apps and display your warning dialog from the DLL. Correct me if I'm wrong, experts.
Technical Details
Message-ID:
<4441d664$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news4.google.com!news2.volia.net!solnet.ch!solnet.ch!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<443a4e43$1@newsgroups.borland.com> <443aac3c$1@newsgroups.borland.com> <443bd8e0$1@newsgroups.borland.com> <443c5e6a@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,14aae0d621067c62 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "David Pratt" <Prattaratt@sbcglobal.net> Newsgroups: borland.public.cppbuilder.nativeapi References: <443a4e43$1@newsgroups.borland.com> <443aac3c$1@newsgroups.borland.com> <443bd8e0$1@newsgroups.borland.com> <443c5e6a@newsgroups.borland.com> Subject: Re: How to find if a DLL is still loaded Date: Sun, 16 Apr 2006 00:30:32 -0500 Lines: 27 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-RFC2646: Format=Flowed; Response NNTP-Posting-Host: 70.137.0.145 Message-ID: <4441d664$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1145165412 70.137.0.145 (15 Apr 2006 22:30:12 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news4.google.com!news2.volia.net!solnet.ch!solnet.ch!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail