From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,56a94442d514b905 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!proxad.net!fr.ip.ndsoftware.net!skynet.be!skynet.be!newspost001!tjb!not-for-mail Date: Thu, 11 Nov 2004 11:34:16 +0100 From: Adrien Plisson Reply-To: aplisson-news@stochastique.net User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: fr-be, fr, en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Plugins/Dynamic Libraries References: <419313b1$0$31235$9a6e19ea@news.newshosting.com> In-Reply-To: <419313b1$0$31235$9a6e19ea@news.newshosting.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <41933fb1$0$9742$ba620e4c@news.skynet.be> Organization: -= Belgacom Usenet Service =- NNTP-Posting-Host: 9b751c96.news.skynet.be X-Trace: 1100169137 news.skynet.be 9742 80.201.130.101:14373 X-Complaints-To: usenet-abuse@skynet.be Xref: g2news1.google.com comp.lang.ada:6139 Date: 2004-11-11T11:34:16+01:00 List-Id: Andrew W wrote: > Under Linux the accepted method is using the DLibs bindings to dlopen etc > http://www.cyberdanx.co.uk/ada95/dlibs.html > > Under Windows the accepted method is using COM > http://www.gnavi.org/gnatcom/ well, let's relieve the pain: for dynamic libraries under Windows, the accepted method is _NOT_ COM ! the equivalent of Windows COM under Linux may be CORBA, and the equivalent of Linux dlopen under Windows is LoadLibrary. these are 2 totally different approaches to the problem: - LoadLibrary and dlopen allows to load a module whose structure is already known through the use of header files, .def files and other documentations. the module itself does expose fully the name of the methods it contains (it may expose it, often decorated) nor the name or types of arguments to those methods. it is the programmer responsability to check that his header file correspond exactly to the version of the module he is trying to use, and the compiler will check that arguments types to method calls are correct. - COM and CORBA allows to load modules whose structure and content is unknown. the module exposes fully its name, version, methods and other definitions. for each method, it also exposes the type of arguments in a rather descriptive way. this allows to plug an unknown module into an application at runtime. it also allows to plug a module which was not existing at the time the application was written. so LoadLibrary an ddlopen are lightweight runtime dynamic library mechanisms whereas COM and CORBA are heavyweight dynamic library mechanisms. if you plan on working on this subject, try to use equivalent mechanisms on each platform you target. please note that there are many bindings to those methods existing: PolyORB, AdaBroker or ORBIT-Ada are CORBA implementations, DLib for dlopen, LoadLibrary should be accessible through Win32Ada, and for COM... well, i don't know... -- rien