TIP: Click on subject to list as thread! ANSI
echo: fidosoft.husky
to: Dmitry Sergienko
from: andrew clarke
date: 2002-11-11 03:26:46
subject: Re: dlls

Sun 2002-11-10 16:44, Dmitry Sergienko (2:464/910.1) wrote to andrew clarke:

 > Why using LoadLibrary() is more convenient than including directiory 
 > with husky DLLs into %PATH%?

Because then you can search both:

#ifdef __WIN32__

    HINSTANCE hi;

    /* search the default places, includes %PATH and current directory */

    hi = LoadLibrary("FCONFMVC.DLL");

    if (hi == NULL)
    {
        /*
         *  couldn't find the DLL, so search for it in the FIDOCONFIG
         *  directory.
         */

        char tmp[300];

        GetEnvironmentVariable("FIDOCONFIG", tmp, sizeof tmp);
        strip_filename(tmp);
        strcat(tmp, "FCONFMVC.DLL");

        hi = LoadLibrary(tmp);
    }

    if (hi == NULL)
    {
        /* use GetLastError() to print an error then exit */
        return;
    }

    atexit(unloaddlls);

    /* use the library */

    /* ... */

#endif

-- mail{at}ozzmosis.com

--- Msged/NT 6.1.1
* Origin: Blizzard of Ozz, Mt Eliza, Victoria, Australia (3:633/267)
SEEN-BY: 633/270
@PATH: 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.