🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Dll and FreeLibrary

#9491
From: Remy Lebeau (TeamB)
Date: Mon, 05 Jul 2004 18:58
28 lines
1675 bytes
"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: <40e9a4cc$1@newsgroups.borland.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-mail
References: <40e96f24$1@newsgroups.borland.com> <40e97125@newsgroups.borland.com> <40e972fc@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,a37346c1cda36d51
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Remy Lebeau \(TeamB\)" <gambit47.no.spam@no.spam.yahoo.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <40e96f24$1@newsgroups.borland.com> <40e97125@newsgroups.borland.com> <40e972fc@newsgroups.borland.com>
Subject: Re: Dll and  FreeLibrary
Date: Mon, 5 Jul 2004 11:58:42 -0700
Lines: 30
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: 68.69.17.10
Message-ID: <40e9a4cc$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1089053900 68.69.17.10 (5 Jul 2004 11:58:20 -0700)
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