From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1025b4,9f5c1c8d844fc69e X-Google-Attributes: gid1025b4,public X-Google-Thread: 10d0a1,9f5c1c8d844fc69e X-Google-Attributes: gid10d0a1,public X-Google-Thread: fcfb9,9f5c1c8d844fc69e X-Google-Attributes: gidfcfb9,public X-Google-Thread: 111c93,9f5c1c8d844fc69e X-Google-Attributes: gid111c93,public X-Google-Thread: 1125fa,9f5c1c8d844fc69e X-Google-Attributes: gid1125fa,public From: sean@forget.about.it (Se�n � Donnchadha) Subject: Re: DLL mess Re: "No-one gets fired for buying Microsoft" Date: 1999/09/23 Message-ID: <37ea25ab.735986702@news.shore.net>#1/1 X-Deja-AN: 528647972 Content-Transfer-Encoding: 7bit References: <37D81FE1.E90C3B1F@winkinc.com> <37ddff0d.347678675@news.shore.net> <37e21eba.355787635@news.shore.net> <37e3383f.362320439@news.shore.net> <37E69470.F3A4F528@internet.de> Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@shore.net X-Trace: news.shore.net 938095446 207.244.116.3 (Thu, 23 Sep 1999 10:04:06 EDT) Organization: Shore.Net/Eco Software, Inc; (info@shore.net) MIME-Version: 1.0 NNTP-Posting-Date: Thu, 23 Sep 1999 10:04:06 EDT Newsgroups: comp.os.linux.alpha,comp.os.linux.advocacy,comp.os.ms-windows.advocacy,comp.os.ms-windows.nt.advocacy,gnu.misc.discuss Volker Dittmar wrote: >> >> That's a good point, but I submit that most users (the kind of folks >> that don't know a shared library from a public library) wouldn't be >> able to take advantage of that. Here, again, Unix benefits from its >> computer-literate user base. > >Which is always a good point... see, M$ tries to dumb people down, >whereas Linux does not. > Windows is targeted at the average consumer. Linux is not. I don't think it's reasonable to expect people to have CS degrees in order to use computers. >> >> No help is required. If the authors of a Windows shared library know >> that an update is not back-compatible, they can do exactly what they'd >> do under Unix - give the updated library a new name (e.g. MFC30 -> >> MFC40). That works just as well in Windows as it does in Unix. > >I've never seen this in practice. And it wouldn't work. > Oh please. This is common practice. MFC and MSVCRT are examples. ANd it works quite well. > >What I've seen in older days was this approach: put the DLL in the >same directory as the app. Say we have to incompatible DLL's, lets >name them MFC30_a.DLL and MFC30_b.DLL - neither the _a nor >the _b shows up in the filename, though. > >App A works best with MFC30_a.DLL, and this DLL is put beside the >App A. App B works with MFC30_b.DLL, but it won't work with the >(older) MFC30_a.DLL. Now load app B - it loads MFC30_b.DLL from >the system directory, and everything works fine. Load app A, and it >links to MFC30_b.DLL, and still it works (or app A shows a few minor >glitches). Unload both apps, and now load app A. > >App A loads MFC30_a.DLL and works fine. Now start app B, and it is >dynamically linked to MFC30_a.DLL - and this won't work. No chance >for app B to load "its" correct DLL. > God, I am *SO* f*cking sick of hearing this bullsh*t! This is *NOT* how DLLs work in 32-bit Windows! Each app would link with its own copy of the DLL. I encourage anyone with a modicum of programming skill to try it for themselves. It amazes me that this lie is still propagated after so many years, especially considering that it takes about three minutes to verify that it's totally false. If you're reading this and you have access to a Windows development system and an interest in the truth, check it out for yourself: ----------- JUNKLIB.CPP ----------- #include #include static HANDLE s_hDLL; BOOL APIENTRY DllMain (HANDLE hDLL, DWORD, LPVOID) { { s_hDLL = hDLL; return TRUE; } void __declspec (dllexport) PrintDLLPath (void) { CHAR fn [8192]; GetModuleFileNameA ((HMODULE) s_hDLL, fn, 8192); printf ("junklib path: %s\n", fn); } ----------- JUNKEXE.CPP ----------- #include extern void __declspec (dllimport) PrintDLLPath (void); void main (void) { PrintDLLPath (); Sleep (INFINITE); } ------------ Instructions ------------ Build JUNKLIB.DLL and JUNKEXE.EXE. Copy both files into each of two empty directories. Run JUNKEXE.EXE from both directories simultaneously. Note that the printed paths are *DIFFERENT*!