Thread View: borland.public.cppbuilder.nativeapi
30 messages
30 total messages
Started by David
Mon, 10 Apr 2006 00:23
How to find if a DLL is still loaded
Author: David
Date: Mon, 10 Apr 2006 00:23
Date: Mon, 10 Apr 2006 00:23
8 lines
1126 bytes
1126 bytes
I wish to know if a DLL which is loaded from another process is still loaded and running. I don't call the DLL myself but just wish to know if it is still loaded in memory. Is this possible ?? thanks in advance David
Re: How to find if a DLL is still loaded
Author: Boba
Date: Mon, 10 Apr 2006 16:52
Date: Mon, 10 Apr 2006 16:52
13 lines
1264 bytes
1264 bytes
"David" <davids@unite.com.au> wrote in message news:443a4e43$1@newsgroups.borland.com... > I wish to know if a DLL which is loaded from another process is still loaded > and running. I don't call the DLL myself but just wish to know if it is > still loaded in memory. > > Is this possible ?? > > thanks in advance > David > try to rename/delete the file.
Re: How to find if a DLL is still loaded
Author: Bob Gonder
Date: Mon, 10 Apr 2006 16:57
Date: Mon, 10 Apr 2006 16:57
17 lines
1416 bytes
1416 bytes
Boba wrote:
>"David" wrote in message
>> I wish to know if a DLL which is loaded from another process is still
>loaded
>> and running. I don't call the DLL myself but just wish to know if it is
>> still loaded in memory.
>>
> try to rename/delete the file.
Might be nicer to use
if( 0 == access(filename,2) )
{ //DLL is free
}else{
//DLL in use or read-only
}
Re: How to find if a DLL is still loaded
Author: Dennis Jones
Date: Mon, 10 Apr 2006 19:04
Date: Mon, 10 Apr 2006 19:04
23 lines
1666 bytes
1666 bytes
"David" <davids@unite.com.au> wrote in message news:443a4e43$1@newsgroups.borland.com... > I wish to know if a DLL which is loaded from another process is still loaded > and running. I don't call the DLL myself but just wish to know if it is > still loaded in memory. > > Is this possible ?? > There's probably an easier way, but the first thing that comes to mind is to enumerate the modules loaded by each process currently running on the system, looking for the one you're interested in. If you don't find it, it isn't loaded. See the following link for how to enumerate all of the processes and modules in the system: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/perfmon/bas e/taking_a_snapshot_and_viewing_processes.asp - Dennis
Re: How to find if a DLL is still loaded
Author: Dennis Jones
Date: Mon, 10 Apr 2006 19:45
Date: Mon, 10 Apr 2006 19:45
68 lines
2673 bytes
2673 bytes
"Dennis Jones" <nospam@nospam.com> wrote in message
news:443aac3c$1@newsgroups.borland.com...
>
> There's probably an easier way, but the first thing that comes to mind is
to
> enumerate the modules loaded by each process currently running on the
> system, looking for the one you're interested in. If you don't find it,
it
> isn't loaded.
Here's a quick and dirty implementation:
bool IsDLLLoaded( const AnsiString &DLLName )
{
bool bIsDLLLoaded = false;
HANDLE hProcessSnapshot = CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS,
0 );
if ( INVALID_HANDLE_VALUE != hProcessSnapshot )
{
PROCESSENTRY32 ProcessEntry;
ProcessEntry.dwSize = sizeof( ProcessEntry );
for ( bool bProcessFound = Process32First( hProcessSnapshot,
&ProcessEntry );
bProcessFound;
bProcessFound = Process32Next( hProcessSnapshot,
&ProcessEntry ) )
{
HANDLE hModuleSnapshot = CreateToolhelp32Snapshot(
TH32CS_SNAPMODULE, ProcessEntry.th32ProcessID );
if ( INVALID_HANDLE_VALUE != hModuleSnapshot )
{
MODULEENTRY32 ModuleEntry;
ModuleEntry.dwSize = sizeof( ModuleEntry );
for ( bool bModuleFound = Module32First( hModuleSnapshot,
&ModuleEntry );
bModuleFound;
bModuleFound = Module32Next( hModuleSnapshot,
&ModuleEntry ) )
{
if ( DLLName == ModuleEntry.szModule )
{
bIsDLLLoaded = true;
break;
}
}
}
CloseHandle( hModuleSnapshot );
if ( bIsDLLLoaded )
{
break;
}
}
CloseHandle( hProcessSnapshot );
}
return bIsDLLLoaded;
}
- Dennis
Re: How to find if a DLL is still loaded
Author: Ed Mulroy
Date: Mon, 10 Apr 2006 19:51
Date: Mon, 10 Apr 2006 19:51
23 lines
1744 bytes
1744 bytes
I think that worked under 16 bit Windows but under Win32 I don't think
access will tell if the file is loaded.
It calls GetFileAttribues and massages the result to decide what to return.
Nothing in the result tells if the file is loaded.
. Ed
> Bob Gonder wrote in message
> news:tf3l32phnths5uo1u53tbh73rsl42315mr@4ax.com...
>
>>> I wish to know if a DLL which is loaded from another process is
>>> still loaded and running. I don't call the DLL myself but just wish
>>> to know if it is still loaded in memory.
>
>> try to rename/delete the file.
>
> Might be nicer to use
> if( 0 == access(filename,2) )
> { //DLL is free
> }else{
> //DLL in use or read-only
> }
Re: How to find if a DLL is still loaded
Author: Bob Gonder
Date: Mon, 10 Apr 2006 21:17
Date: Mon, 10 Apr 2006 21:17
10 lines
1451 bytes
1451 bytes
Ed Mulroy wrote: >I think that worked under 16 bit Windows but under Win32 I don't think >access will tell if the file is loaded. > >It calls GetFileAttribues and massages the result to decide what to return. >Nothing in the result tells if the file is loaded. Ok, then open file with write access will fail if in use, and doesn't mess with the file if it isn't in use, as rename or delete would.
Re: How to find if a DLL is still loaded
Author: David
Date: Tue, 11 Apr 2006 13:56
Date: Tue, 11 Apr 2006 13:56
39 lines
2478 bytes
2478 bytes
> 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 "Boba" <Boba@somewhere.world> wrote in message news:443bd8e0$1@newsgroups.borland.com... > "Dennis Jones" <nospam@nospam.com> wrote in message > news:443aac3c$1@newsgroups.borland.com... >> ... >> There's probably an easier way, but the first thing that comes to mind is > to >> enumerate the modules loaded by each process currently running on the >> system, looking for the one you're interested in. If you don't find it, > it >> isn't loaded. >> > been there, done that... > if a module is not curremtly beeing used by any of the software visible to > UI via what you're talking about, there are still tons of software running > in below UI level that may still need those modules in which case you may > think the module is not in use: try to delete... if it fails - keep > digging > deeper. > I still don't understand what David (the op) is trying to achieve. > >
Re: How to find if a DLL is still loaded
Author: Boba
Date: Tue, 11 Apr 2006 16:27
Date: Tue, 11 Apr 2006 16:27
17 lines
1704 bytes
1704 bytes
"Dennis Jones" <nospam@nospam.com> wrote in message news:443aac3c$1@newsgroups.borland.com... > ... > There's probably an easier way, but the first thing that comes to mind is to > enumerate the modules loaded by each process currently running on the > system, looking for the one you're interested in. If you don't find it, it > isn't loaded. > been there, done that... if a module is not curremtly beeing used by any of the software visible to UI via what you're talking about, there are still tons of software running in below UI level that may still need those modules in which case you may think the module is not in use: try to delete... if it fails - keep digging deeper. I still don't understand what David (the op) is trying to achieve.
Re: How to find if a DLL is still loaded
Author: Dennis Jones
Date: Tue, 11 Apr 2006 18:35
Date: Tue, 11 Apr 2006 18:35
21 lines
1821 bytes
1821 bytes
"Boba" <Boba@somewhere.world> wrote in message news:443bd8e0$1@newsgroups.borland.com... > been there, done that... > if a module is not curremtly beeing used by any of the software visible to > UI via what you're talking about, there are still tons of software running > in below UI level that may still need those modules in which case you may > think the module is not in use: try to delete... if it fails - keep digging > deeper. Can you explain what you mean by, "visible to the UI" and "below UI level"? CreateToolhelp32Snapshot has no notion of what's "visible to the UI" or "below UI level." According to MSDN, using the TH32CS_SNAPPROCESS flag results in a list of "...all processes in the system." Can you provide an example of a process that would not be in the list of "all processes in the system?" - Dennis
Re: How to find if a DLL is still loaded
Author: David
Date: Wed, 12 Apr 2006 17:36
Date: Wed, 12 Apr 2006 17:36
25 lines
1671 bytes
1671 bytes
Hello Boba So how do you tap into the message que of a DLL ?? Do you have any examples ?? Regards David "Boba" <Boba@somewhere.world> wrote in message news:443d2e58$1@newsgroups.borland.com... > "David" <davids@unite.com.au> wrote in message > news:443c5e6a@newsgroups.borland.com... >> ... >> Actually I do have access to source code for the DLL ... > > that always helps. > >> I asked here once whether or not you could send >> messages to a DLL and it wasn't a simple proposition either. > > a dll is no different from any other application with an msg pump. > >
Re: How to find if a DLL is still loaded
Author: Boba
Date: Wed, 12 Apr 2006 18:50
Date: Wed, 12 Apr 2006 18:50
11 lines
1284 bytes
1284 bytes
"David" <davids@unite.com.au> wrote in message news:443c5e6a@newsgroups.borland.com... > ... > Actually I do have access to source code for the DLL ... that always helps. > I asked here once whether or not you could send > messages to a DLL and it wasn't a simple proposition either. a dll is no different from any other application with an msg pump.
Re: How to find if a DLL is still loaded
Author: David
Date: Thu, 13 Apr 2006 02:08
Date: Thu, 13 Apr 2006 02:08
28 lines
1820 bytes
1820 bytes
Hello The DLL is loaded after the exceutable is run. I don't have access to the source code of the calling app, only the DLL. regards david "Boba" <Boba@somewhere.world> wrote in message news:443e5780$1@newsgroups.borland.com... > "David" <davids@unite.com.au> wrote in message > news:443de373@newsgroups.borland.com... >> Hello Boba >> >> So how do you tap into the message que of a DLL ?? >> >> Do you have any examples ?? >> >> Regards >> David >> >> > Hello David; > are you talking about a dll loaded prio your code starts? > is it a library you attach? is it something you coded? > >
Re: How to find if a DLL is still loaded
Author: Dennis Jones
Date: Thu, 13 Apr 2006 15:09
Date: Thu, 13 Apr 2006 15:09
27 lines
2061 bytes
2061 bytes
"Boba" <Boba@somewhere.world> wrote in message news:443e58c4$1@newsgroups.borland.com... > > "Dennis Jones" <nospam@nospam.com> wrote in message > news:443bf6f6$1@newsgroups.borland.com... > > ... > > Can you provide an example of a process that would not be > in the list of "all processes in the system?" > > if you have an nt handy, look to see if the Client Server Runtime > Process > is running; if so - is the module loaded? what do you use to list 'all' > the modules curently loaded? I do have NT handy, and I'm not sure where you were suggesting I look, but I do not see that particular process in task manager. The code I posted earlier is what I used (see the message I posted on 4/10). That code, however, will not run on NT because NT does not provide imeplementations of the CreateToolhelp32Snapshot-related functions. If you must use NT, there are functions in PSAPI.DLL that will allow you to enumerate processes and modules in a fashion similar to how I did it in my example. - Dennis
Re: How to find if a DLL is still loaded
Author: Boba
Date: Thu, 13 Apr 2006 15:58
Date: Thu, 13 Apr 2006 15:58
15 lines
1464 bytes
1464 bytes
"David" <davids@unite.com.au> wrote in message news:443de373@newsgroups.borland.com... > Hello Boba > > So how do you tap into the message que of a DLL ?? > > Do you have any examples ?? > > Regards > David > > Hello David; are you talking about a dll loaded prio your code starts? is it a library you attach? is it something you coded?
Re: How to find if a DLL is still loaded
Author: Boba
Date: Thu, 13 Apr 2006 16:03
Date: Thu, 13 Apr 2006 16:03
11 lines
1399 bytes
1399 bytes
"Dennis Jones" <nospam@nospam.com> wrote in message news:443bf6f6$1@newsgroups.borland.com... > ... > Can you provide an example of a process that would not be in the list of "all processes in the system?" if you have an nt handy, look to see if the Client Server Runtime Process is running; if so - is the module loaded? what do you use to list 'all' the modules curently loaded?
Re: How to find if a DLL is still loaded
Author: Boba
Date: Thu, 13 Apr 2006 16:51
Date: Thu, 13 Apr 2006 16:51
11 lines
1565 bytes
1565 bytes
"David" <davids@unite.com.au> wrote in message news:443e5b4d@newsgroups.borland.com... > Hello > > The DLL is loaded after the exceutable is run. I don't have access to the > source code of the calling app, only the DLL. > if you have access tro that dll's source code you are the one who knows if the dll has a message queue and if it's got its pump plugged in and switched on.
Re: How to find if a DLL is still loaded
Author: Boba
Date: Thu, 13 Apr 2006 17:03
Date: Thu, 13 Apr 2006 17:03
17 lines
1646 bytes
1646 bytes
"Dennis Jones" <nospam@nospam.com> wrote in message news:443e698b$1@newsgroups.borland.com... > > I do have NT handy, and I'm not sure where you were suggesting I look, but I > do not see that particular process in task manager. run System Information from the Start/Programs/Accessories/System Tools/System Information (mssysinfo32.exe) Look@the Running Tasks branch of Software Environment. > ... because NT does not provide > imeplementations of the CreateToolhelp32Snapshot-related functions. sure it does. It doesn't matter what you call those functions: most of the useful ones don't have names anyway.
Re: How to find if a DLL is still loaded
Author: Boba
Date: Thu, 13 Apr 2006 17:08
Date: Thu, 13 Apr 2006 17:08
4 lines
1241 bytes
1241 bytes
> It doesn't matter what you call those functions: most of the useful ones > don't have names anyway. I mean the end user versions of Windows.
Re: How to find if a DLL is still loaded
Author: Dennis Jones
Date: Thu, 13 Apr 2006 20:05
Date: Thu, 13 Apr 2006 20:05
14 lines
1545 bytes
1545 bytes
"Boba" <Boba@somewhere.world> wrote in message news:443e8465$1@newsgroups.borland.com... > > ... because NT does not provide > > imeplementations of the CreateToolhelp32Snapshot-related functions. > > sure it does. Try compiling and executing a program that uses CreateToolhelp32Snapshot in Windows NT (NT 4 workstation). You'll get an error that says, in effect, "CreateToolhelp32Snapshot not found in kernel32.dll." - Dennis
Re: How to find if a DLL is still loaded
Author: Dennis Jones
Date: Thu, 13 Apr 2006 20:06
Date: Thu, 13 Apr 2006 20:06
21 lines
1790 bytes
1790 bytes
"Dennis Jones" <nospam@nospam.com> wrote in message news:443eaef2$1@newsgroups.borland.com... > > "Boba" <Boba@somewhere.world> wrote in message > news:443e8465$1@newsgroups.borland.com... > > > > ... because NT does not provide > > > imeplementations of the CreateToolhelp32Snapshot-related functions. > > > > sure it does. > > Try compiling and executing a program that uses CreateToolhelp32Snapshot in > Windows NT (NT 4 workstation). You'll get an error that says, in effect, > "CreateToolhelp32Snapshot not found in kernel32.dll." I can provide such a program, if you want to try it without writing one of your own. - Dennis
Re: How to find if a DLL is still loaded
Author: Dennis Jones
Date: Thu, 13 Apr 2006 20:12
Date: Thu, 13 Apr 2006 20:12
13 lines
1666 bytes
1666 bytes
"Boba" <Boba@somewhere.world> wrote in message news:443e8465$1@newsgroups.borland.com... > run System Information from the Start/Programs/Accessories/System > Tools/System Information > (mssysinfo32.exe) Look@the Running Tasks branch of Software Environment. I think you mean msinfo32 (not mssysinfo32). And if so, we are not talking about the same OS. You keep saying "NT", but you are referring to things that are in XP but are not in NT (like CreateToolhelp32Snapshot). - Dennis
Re: How to find if a DLL is still loaded
Author: Dennis Jones
Date: Fri, 14 Apr 2006 15:20
Date: Fri, 14 Apr 2006 15:20
24 lines
2067 bytes
2067 bytes
"Boba" <Boba@somewhere.world> wrote in message news:443fa386@newsgroups.borland.com... > "Dennis Jones" <nospam@nospam.com> wrote in message > news:443eb0bd$1@newsgroups.borland.com... > > > > I think you mean msinfo32 (not mssysinfo32). > > typo > > > And if so, we are not talking > > about the same OS. You keep saying "NT", but you are referring to > things > > that are in XP but are not in NT (like CreateToolhelp32Snapshot). > > How long have you been using Windows -- less than 5 years? Windows NT was introduced several years (1993) before Windows 95, so when you say "Windows NT," you're referring to very old operating system. There is a very definite difference between Windows NT and Windows XP (which wasn't introduced until 2001), so do not make the assumption that NT and XP they are one and the same -- they are not (they're not even close). - Dennis
Re: How to find if a DLL is still loaded
Author: Boba
Date: Fri, 14 Apr 2006 15:34
Date: Fri, 14 Apr 2006 15:34
14 lines
1603 bytes
1603 bytes
"Dennis Jones" <nospam@nospam.com> wrote in message news:443eb0bd$1@newsgroups.borland.com... > > I think you mean msinfo32 (not mssysinfo32). typo > And if so, we are not talking > about the same OS. You keep saying "NT", but you are referring to things > that are in XP but are not in NT (like CreateToolhelp32Snapshot). > i am not smart enough to see the difference ...
Re: How to find if a DLL is still loaded
Author: Jonathan Benedicto
Date: Fri, 14 Apr 2006 15:35
Date: Fri, 14 Apr 2006 15:35
24 lines
2224 bytes
2224 bytes
Dennis Jones wrote: > Windows NT was introduced several years (1993) before Windows 95, > so when you say "Windows NT," you're referring to very old operating > system. There is a very definite difference between Windows NT and > Windows XP (which wasn't introduced until 2001), so do not make the > assumption that NT and XP they are one and the same -- they are not > (they're not even close). Wikipedia says this: Windows XP and Windows Server 2003 are the latest versions of Windows NT, though they are not branded as such for marketing purposes. AFAIK, XP is Windows NT 5.1 Also Windows NT went through four versions before becoming Windows 2000. Wikipedia has a table of all the Windows NT versions here: http://en.wikipedia.org/wiki/Windows_NT. You just have to scroll down to the Releases section. Jonathan ------------------------ TwineCompiler, blazingly fast C++ compiles: http://www.jomitech.com/#twine ------------------------
Re: How to find if a DLL is still loaded
Author: Boba
Date: Sat, 15 Apr 2006 00:21
Date: Sat, 15 Apr 2006 00:21
26 lines
2338 bytes
2338 bytes
My thanks go to Jonathan. Dennis; there are 2 (two) branches of what you call Windows marketed by MS: Windows written by MS (the idea belongs to Apple) and NT written outside of MS. The former has deadended with Millennium and the later is still around in the form of 2003, xp,... On Tuesday you asked me "Can you explain what you mean by, "visible to the UI" and "below UI level"?" I simply don't like to use the abbriviation GUI 'cause I know folks who can not see as well as I can but they make much more money out of the toy we call a PC. Speaking of levels - I am not a paperback writer - so just take a look at the following table (fixed font recommended): Level Tools log($/hr) -----------+-------------+------------- GUI Borland/MS 1 Executive MS/Borland 2 Kernel MS 3 HAL MS+ 4 HW Screwdriver priceless -----------+-------------+------------- This particular NG covers the top level issues only. Boba
Re: How to find if a DLL is still loaded
Author: Dennis Jones
Date: Sat, 15 Apr 2006 01:18
Date: Sat, 15 Apr 2006 01:18
31 lines
2858 bytes
2858 bytes
"Jonathan Benedicto" <invalid@nobody.com> wrote in message news:443fc12b$1@newsgroups.borland.com... > Dennis Jones wrote: > > Windows NT was introduced several years (1993) before Windows 95, > > so when you say "Windows NT," you're referring to very old operating > > system. There is a very definite difference between Windows NT and > > Windows XP (which wasn't introduced until 2001), so do not make the > > assumption that NT and XP they are one and the same -- they are not > > (they're not even close). > > Wikipedia says this: > Windows XP and Windows Server 2003 are the latest versions of Windows NT, > though they are not branded as such for marketing purposes. AFAIK, XP is > Windows NT 5.1 I understand that, but the fact is when people refer to Windows NT, it is generally understood that they are referring to the "old" Windows NT, that is, before they changed the name to Windows 2000 and eventually Windows XP. I don't know about you, but I've never heard anyone refer to XP as "Windows NT 5.1" -- they just call it "XP." So, my point remains. Windows NT (pre-2000) does NOT have the same functionality that Windows 2000 and XP do. So if you are going to say that Windows NT has the CreateToolhelp32Snapshot function, you had better indicate which version of the operating system you are talking about, either by giving the name (NT, 2K, XP, etc) or by using the version number (which, of course, nobody does because the mnemonic is much easier to remember), because otherwise you're going to run into misunderstandings like this one! - Dennis
Re: How to find if a DLL is still loaded
Author: Dennis Jones
Date: Sat, 15 Apr 2006 01:23
Date: Sat, 15 Apr 2006 01:23
43 lines
2786 bytes
2786 bytes
"Boba" <Boba@somewhere.world> wrote in message news:44401ee0$1@newsgroups.borland.com... > My thanks go to Jonathan. > Dennis; > there are 2 (two) branches of what you call Windows marketed by MS: > Windows written by MS (the idea belongs to Apple) and NT written > outside of MS. The former has deadended with Millennium and the later is > still around in the form of 2003, xp Please read my reply to Jonathan. ,... On Tuesday you asked me > "Can you explain what you mean by, "visible to the UI" and "below UI > level"?" > I simply don't like to use the abbriviation GUI 'cause I know folks > who can not see as well as I can but they make much more money out of > the toy we call a PC. Speaking of levels - I am not a paperback writer - > so > just take a look at the following table (fixed font recommended): I have no idea what you are talking about! > Level Tools log($/hr) > -----------+-------------+------------- > GUI Borland/MS 1 > Executive MS/Borland 2 > Kernel MS 3 > HAL MS+ 4 > HW Screwdriver priceless > -----------+-------------+------------- > > This particular NG covers the top level issues only. Huh? Where did you get *that* idea? This newsgroup covers the Windows API (hence the name, "nativeapi"), which is, by no means limited to GUI functions. This thread is going nowhere fast -- I think it has breathed its last. - Dennis
Re: How to find if a DLL is still loaded
Author: 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.
Re: How to find if a DLL is still loaded
Author: David
Date: Wed, 19 Apr 2006 14:14
Date: Wed, 19 Apr 2006 14:14
40 lines
2588 bytes
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. >
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads