Article View: borland.public.cppbuilder.nativeapi
Article #9228DllEntryPoint
From: Kathleen Beaumont
Date: Tue, 27 Jul 2004 15:03
Date: Tue, 27 Jul 2004 15:03
57 lines
2680 bytes
2680 bytes
I found messages in the archives that resemble the problem I'm having,
but none of the solutions I saw there helped. I'll try to provide enough
information to get help from someone here.
PROBLEM: My implementation of DllEntryPoint does not get accessed.
Setting a breakpoint in DllEntryPoint is ignored when debugging my DLL.
Placing a call to MessageBox at the top of DllEntryPoint never pops a
message box. Thus, I think it is simply being ignored.
Environment: BCB6 on XP Pro
My host application loads the DLL using LoadLibrary, unloads using
FreeLibrary. It is a console app, and the "Build with runtime packages"
option is disabled in Project | Options | Packages.
I do not implicitly link in the DLL (that is, I do NOT include the .LIB
for the .DLL in the project files).
I can set a breakpoint anywhere else in the DLL code, and the
application breaks as expected.
I placed DllEntryPoint at the bottom of one of the implementation files.
(Does a declaration need to exist in my header file?) Here is what it
contains:
#if defined(EEWINDOWS)
#include <windows.h>
BOOL WINAPI DllEntryPoint(HINSTANCE hinst, DWORD reason,
LPVOID reserved)
{
switch (reason)
{
case DLL_PROCESS_ATTACH:
break;
case DLL_PROCESS_DETACH:
for (int cookie = 0; cookie < MaxMetaFiles; cookie++)
{
if (MetaFileList[cookie])
{
EEx_Exit(cookie);
}
}
break;
}
return TRUE;
}
//---------------------------------------------------------------------------
#endif
Conditional define EEWINDOWS is defined in Project | Options |
Conditional Defines.
Thank you for any guidance you can give me.
Kathleen
Technical Details
Message-ID:
<41066ED9.7030105@catalinasystems.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,542429ed898459fa,start X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit Message-ID: <41066ED9.7030105@catalinasystems.com> Date: Tue, 27 Jul 2004 08:03:53 -0700 From: Kathleen Beaumont <kathleen@catalinasystems.com> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.1) Gecko/20040707 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.nativeapi Subject: DllEntryPoint Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 205.217.46.150 X-Trace: newsgroups.borland.com 1090940629 205.217.46.150 (27 Jul 2004 08:03:49 -0700) Lines: 57 Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail