Apr 032009
 

This may not be a big deal to those who knows Ada well, but it is really big move to me – now I know how to create Ada binding.

I’m using win32ada with GNAT to program as everybody knows, but soon I found win32ada is not complete. People told me current version was created in year 1999, thus most features from Windows 2000/XP/Vista are not there. I’m missing two important APIs for now, SetWindowRgn and LoadImage, for some special visual effect, but obviously those functions are not there.

So once I understand how binding works, things are getting easy enough:

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;
pragma Import (
Convention    => StdCall,
Entity        => LoadImage,
External_Name => "LoadImageA"
);

pragma Linker_Options("-luser32");

“pragma  Linker_Options” is not a must as win32ada includes it.

 Posted by at 22:37

Sorry, the comment form is closed at this time.