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-Thread: 103376,3e13181d651876b8 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!newsfeed.freenet.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Jerry van Dijk Newsgroups: comp.lang.ada Subject: Re: win32ada coverage Date: Sun, 05 Apr 2009 12:44:13 +0200 Message-ID: References: <785addc4-95e3-48d6-ba9f-e698d26922b5@s12g2000prc.googlegroups.com> <0c1ee36a-67a7-4bf1-9a38-46ea9eae7cf2@s12g2000prc.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: individual.net bW8tneweFcPEnGuquiATRgBPOC5ti3rgi997YyiCKZe8m1gXbA Cancel-Lock: sha1:eKGNgnf/2Lccfg7+Kx+mGQZQUbQ= sha1:q+Q2HGH7kFK72NqIwhRBkd/69bs= User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.0 (windows-nt) Xref: g2news1.google.com comp.lang.ada:4444 Date: 2009-04-05T12:44:13+02:00 List-Id: xiehang@gmail.com writes: > Yea I know the W/A trick, but the win32ada I have does not have > LoadImageA nor LoadImageW. > > Does your version of win32ada have them? I assumed so since I used them before, but checking GNAT 2008 they are indeed missing. Assumptions are always bad! :-) Anyway, since the functions are in the import library, it is easy to define an extra package for our own API definitions, see below. Untested, us at your own risk, blah, blah. Note that you might have to add some constant definitions. -- -*- Mode: Ada -*- -- Filename : win32-addon.ads -- Description : Module to add missing API stuff to win32ada -- Author : Jerry van Dijk -- Created On : Sun Apr 05 12:02:59 2009 -- Last Modified By: . -- Last Modified On: . -- Update Count : 0 -- Status : Unknown, Use with caution! ------------------------------------------------------------------------------- with Win32; With Win32.Winnt; with Win32.Windef; package Win32.AddOn is -------------------------- -- LoadImage function -- -------------------------- function LoadImageA (hInst : Win32.Windef.HINSTANCE; lpszName : Win32.Winnt.LPCTSTR; uType : Win32.UINT; cxDesired : Win32.INT; cyDesired : Win32.INT; FuLoad : Win32.UINT) return Win32.Winnt.HANDLE; function LoadImageW (hInst : Win32.Windef.HINSTANCE; lpszName : Win32.Winnt.LPCTSTR; uType : Win32.UINT; cxDesired : Win32.INT; cyDesired : Win32.INT; fuLoad : Win32.UINT) return Win32.Winnt.HANDLE; function LoadImage (hInst : Win32.Windef.HINSTANCE; lpszName : Win32.Winnt.LPCTSTR; uType : Win32.UINT; cxDesired : Win32.INT; cyDesired : Win32.INT; fuLoad : Win32.UINT) return Win32.Winnt.HANDLE renames LoadImageA; private -- import from user32.a pragma Import (StdCall, LoadImageA, "LoadImagaA"); pragma Import (StdCall, LoadImageW, "LoadImagaW"); end Win32.AddOn; -- -- Jerry van Dijk -- Leiden, Holland -- -- The early bird may get the worm, but the second mouse gets the cheese!!