Article View: borland.public.cppbuilder.nativeapi
Article #9500Re: Dll and FreeLibrary
From: sam
Date: Tue, 06 Jul 2004 07:39
Date: Tue, 06 Jul 2004 07:39
36 lines
2027 bytes
2027 bytes
Thank you very much for your very good samples.
It works fine.
Sam
"Remy Lebeau (TeamB)" <gambit47.no.spam@no.spam.yahoo.com> a οΏ½crit dans le
message de news:40e9a4cc$1@newsgroups.borland.com...
>
> "Hugo Dias" <synchron@nospam.synchron-systems.com> wrote in message
> news:40e972fc@newsgroups.borland.com...
>
> > case DLL_PROCESS_ATTACH:
> > case DLL_THREAD_ATTACH:
> > hInstance = LoadLibrary ("test.dll");
> > break;
>
> Why re-load the same DLL on every thread attachment? Just do it once at
> process attachment only:
>
> int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*)
> {
> switch( reason )
> {
> case DLL_PROCESS_ATTACH:
> hInstance = LoadLibrary ("test.dll");
> break;
> case DLL_PROCESS_DETACH:
> FreeLibrary(hInstance);
> break;
> }
> return 1;
> }
>
>
> Gambit
>
>
Technical Details
Message-ID:
<40ea5747$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<40e96f24$1@newsgroups.borland.com> <40e97125@newsgroups.borland.com> <40e972fc@newsgroups.borland.com> <40e9a4cc$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,a37346c1cda36d51 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII Reply-To: "sam" <skneife3@wanadoo.fr> From: "sam" <skneife3@wanadoo.fr> Newsgroups: borland.public.cppbuilder.nativeapi References: <40e96f24$1@newsgroups.borland.com> <40e97125@newsgroups.borland.com> <40e972fc@newsgroups.borland.com> <40e9a4cc$1@newsgroups.borland.com> Subject: Re: Dll and FreeLibrary Date: Tue, 6 Jul 2004 09:39:48 +0200 Lines: 38 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 NNTP-Posting-Host: 62.23.237.242 Message-ID: <40ea5747$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1089099591 62.23.237.242 (6 Jul 2004 00:39:51 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail