🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #3925

Re: How to find if a DLL is still loaded

#3925
From: David
Date: Wed, 19 Apr 2006 14:14
40 lines
2588 bytes
Hello

Yes I ended up doing something like this. I even sent a message from the DLL 
to the app to tell it when the PROCESS_DETACH was called so it knew that the 
DLL was no longer in use.

It worked out OK doing this way.

regards
david


"David Pratt" <Prattaratt@sbcglobal.net> wrote in message 
news:4441d664$1@newsgroups.borland.com...
>
> "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: <444645bd@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news1.google.com!news4.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <443a4e43$1@newsgroups.borland.com> <443aac3c$1@newsgroups.borland.com> <443bd8e0$1@newsgroups.borland.com> <443c5e6a@newsgroups.borland.com> <4441d664$1@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" <davids@unite.com.au>
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> <4441d664$1@newsgroups.borland.com>
Subject: Re: How to find if a DLL is still loaded
Date: Thu, 20 Apr 2006 00:14:19 +1000
Lines: 42
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: 211.26.206.233
Message-ID: <444645bd@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1145456061 211.26.206.233 (19 Apr 2006 07:14:21 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news1.google.com!news4.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail