comp.lang.ada
 help / color / mirror / Atom feed
From: Jerry van Dijk <jerry@jerryware.nl>
Subject: Re: win32ada coverage
Date: Sun, 05 Apr 2009 12:44:13 +0200
Date: 2009-04-05T12:44:13+02:00	[thread overview]
Message-ID: <uvdpjwfb6.fsf@smtp.jerryware.nl> (raw)
In-Reply-To: 0c1ee36a-67a7-4bf1-9a38-46ea9eae7cf2@s12g2000prc.googlegroups.com

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!!



      parent reply	other threads:[~2009-04-05 10:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-03 21:08 win32ada coverage xiehang
2009-04-03 22:51 ` anon
2009-04-04  0:52   ` xiehang
2009-04-04  6:38   ` Jerry van Dijk
2009-04-05  4:30     ` xiehang
2009-04-05  5:58       ` anon
2009-04-05 10:44       ` Jerry van Dijk [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox