🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

DllMain vs DllEntryPoint

#4205
From: nicolasr
Date: Sun, 05 Mar 2006 14:58
41 lines
2125 bytes
Hi,

I'm trying to rebuild a VS DLL project with BCB.
I created a new DLL project with the VS option
checked, removed the created main cpp file
and added the source code files from the VS project.

After some tweaks it compiled and linked fine
but I have problems with the entry point function.

Since I used the VS option the entry point expected
is DllMain() at least this is what I see in the .bpf file.

This DllMain() function is implemented as follows:

// Comment from the original VS project:
// If we declare the correct C runtime entrypoint and then forward it to the 
DShow base
// classes we will be sure that both the C/C++ runtimes and the base classes 
are initialized
// correctly
extern "C" BOOL WINAPI DllEntryPoint(HINSTANCE, ULONG, LPVOID);

BOOL WINAPI DllMain(HANDLE hDllHandle, DWORD dwReason, LPVOID lpReserved)
{
    //MessageBox(0, "DllMain", "", 0);
    return DllEntryPoint(reinterpret_cast<HINSTANCE>(hDllHandle), dwReason, 
lpReserved);
}

The referenced DllEntryPoint() function is implemented
in the "base class library".

Problem: the above DllMain() gets never called. Instead
the DllEntryPoint() function seems to be called directly.
Like BCB ignores the direction to call DllMain().


Any ideas how to solve this?
thanks,
Nick 
Technical Details
Message-ID: <440afc9e@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news4.google.com!news2.volia.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,ca089694a98ab44b,start
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "nicolasr" <nicolasrNOSPAMATSIGNgmx.net>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: DllMain vs DllEntryPoint
Date: Sun, 5 Mar 2006 15:58:34 +0100
Lines: 43
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; Original
NNTP-Posting-Host: 84.174.202.56
Message-ID: <440afc9e@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1141570718 84.174.202.56 (5 Mar 2006 06:58:38 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news4.google.com!news2.volia.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail