🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: DllMain vs DllEntryPoint

#4163
From: nicolasr
Date: Sat, 11 Mar 2006 02:32
54 lines
2953 bytes
Thanks. I tried to investigate this further and here is the result from my
very simple test case:

Projectgroup with three projects:

1) C++ DLL, VS style, that implements both DllMain and DllEntryPoint.
In the .bpf file DllMain is specified as the entry point.

2) C DLL, VS style, that implements both DllMain and DllEntryPoint.
In the .bpf file DllMain is specified as the entry point.

3) Simple application with two buttons that call LoadLibrary on either DLL.

Result: in any case DllEntryPoint is called! DllMain is ignored.

So I guess I have to find some workaround and modify the existing MS
"base classes" for which I luckily have source code.

thanks for your ideas,
Nick


>
>> thanks for your reply!
>> However, I think I do not quite understand the distinction you make.
>> My DLL is a COM in-process server. But does instantiating a COM
>> server not result in a call to LoadLibrary() finally?
>> I tested the DLL in a COM environment and now also called LoadLibrary()
>> on it myself. In both cases my DllMain() is not called :-(
>
> I made an assumption that a COM server always pass by a DllMain entry 
> point.
> That was based on Win32 Prog. Ref. under Structuring a Namespace 
> Extension:
>
> As a reminder, the construction of an in-process server DLL requires the
> implementation of a DLL that exports the following functions:
> DllMain DllGetClassObject DllUnloadNow
>
> That was reinforced by the fact that i use such a DLL with the following 
> declaration.
> extern "C" int WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID 
> lpReserved)
> Which is more a C declaration than a C++.
>
> But i also found on http://tinyurl.com/oecsq
>
> DllMain() is not the entry point in a C++ DLL, DLLEntryPoint() is.  (Remy 
> Lebeau)
>
> Sorry for the misleading.
>
> -- 
> JF Jolin 
Technical Details
Message-ID: <441236b6@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news2.google.com!news3.google.com!news.glorb.com!multikabel.net!feed20.multikabel.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <440afc9e@newsgroups.borland.com> <ops53ry5hgz6rw7b@newsgroups.borland.com> <440f871c$1@newsgroups.borland.com> <ops54r88pbz6rw7b@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: "nicolasr" <nicolasrNOSPAMATSIGNgmx.net>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <440afc9e@newsgroups.borland.com> <ops53ry5hgz6rw7b@newsgroups.borland.com> <440f871c$1@newsgroups.borland.com> <ops54r88pbz6rw7b@newsgroups.borland.com>
Subject: Re: DllMain vs DllEntryPoint
Date: Sat, 11 Mar 2006 03:32:18 +0100
Lines: 56
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: 84.174.183.237
Message-ID: <441236b6@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1142044342 84.174.183.237 (10 Mar 2006 18:32:22 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news2.google.com!news3.google.com!news.glorb.com!multikabel.net!feed20.multikabel.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail