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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e68e37dea4572ced X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-01-11 22:18:03 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!elnk-pas-nf1!elnk-nf2-pas!newsfeed.earthlink.net!attbi_feed3!attbi.com!attbi_s01.POSTED!not-for-mail From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: LoadLibrary problem References: X-Newsreader: Tom's custom newsreader Message-ID: NNTP-Posting-Host: 67.161.24.134 X-Complaints-To: abuse@comcast.net X-Trace: attbi_s01 1073888282 67.161.24.134 (Mon, 12 Jan 2004 06:18:02 GMT) NNTP-Posting-Date: Mon, 12 Jan 2004 06:18:02 GMT Organization: Comcast Online Date: Mon, 12 Jan 2004 06:18:02 GMT Xref: archiver1.google.com comp.lang.ada:4350 Date: 2004-01-12T06:18:02+00:00 List-Id: >What's more, instead of writing your own interface, you can use >the imports provided in the win32-winbase.ads file, viz.: > > pragma Import(Stdcall, LoadLibraryA, "LoadLibraryA"); -- >winbase.h:3619 > ... >Also, note that the C calling convention is not the proper convention for >use with Win32 libraries. Or you could use Claw: package CLAW.DLL is ... type DLL_Type is new Ada.Finalization.Controlled with private; procedure Load (DLL_Object: in out DLL_Type; DLL_File: in String); ... and let it worry about things like Ada->C strings, proper finalization of the handle, and StdCall vs C.