{"id":199,"date":"2009-04-03T22:37:57","date_gmt":"2009-04-04T06:37:57","guid":{"rendered":"http:\/\/xiehang.com\/blog\/?p=199"},"modified":"2009-04-03T22:37:57","modified_gmt":"2009-04-04T06:37:57","slug":"making-good-progress","status":"publish","type":"post","link":"https:\/\/xiehang.com\/blog\/2009\/04\/03\/making-good-progress\/","title":{"rendered":"Making good progress"},"content":{"rendered":"

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.<\/p>\n

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.<\/p>\n

So once I understand how binding works, things are getting easy enough:<\/p>\n

function LoadImage (\r\nhInst\u00a0\u00a0\u00a0\u00a0 : Win32.WinDef.HINSTANCE;\r\nlpszName\u00a0 : Win32.WinNT.LPCTSTR;\r\nuType\u00a0\u00a0\u00a0\u00a0 : Win32.UINT;\r\ncxDesired : Win32.INT;\r\ncyDesired : Win32.INT;\r\nfuLoad\u00a0\u00a0\u00a0 : Win32.UINT\r\n) return Win32.WinNT.HANDLE;\r\npragma Import (\r\nConvention\u00a0\u00a0\u00a0 => StdCall,\r\nEntity\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 => LoadImage,\r\nExternal_Name => \"LoadImageA\"\r\n);\r\n\r\npragma Linker_Options(\"-luser32\");<\/pre>\n

“pragma\u00a0 Linker_Options” is not a must as win32ada includes it.<\/p>\n","protected":false},"excerpt":{"rendered":"

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 […]<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/posts\/199"}],"collection":[{"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/comments?post=199"}],"version-history":[{"count":1,"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/posts\/199\/revisions"}],"predecessor-version":[{"id":200,"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/posts\/199\/revisions\/200"}],"wp:attachment":[{"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/media?parent=199"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/categories?post=199"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/tags?post=199"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}