🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: DllMain vs DllEntryPoint

#4079
From: David Pratt
Date: Mon, 27 Mar 2006 14:15
48 lines
2482 bytes
"nicolasr" <nicolasrNOSPAMATSIGNgmx.net> wrote in message 
news:440afc9e@newsgroups.borland.com...
> 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


Talke a look at the following article in borlands developer network site:
http://community.borland.com/article/0,1410,22432,00.html 
Technical Details
Message-ID: <4427f37f$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!newshub.sdsu.edu!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <440afc9e@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,ca089694a98ab44b
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "David Pratt" <Prattaratt@sbcglobal.net>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <440afc9e@newsgroups.borland.com>
Subject: Re: DllMain vs DllEntryPoint
Date: Mon, 27 Mar 2006 08:15:33 -0600
Lines: 50
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.3.203
Message-ID: <4427f37f$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1143468927 70.137.3.203 (27 Mar 2006 06:15:27 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!newshub.sdsu.edu!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail