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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no 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!news2.google.com!news.glorb.com!news2.glorb.com!wn11feed!worldnet.att.net!bgtnsc04-news.ops.worldnet.att.net.POSTED!53ab2750!not-for-mail Newsgroups: comp.lang.ada From: anon@anon.org (anon) Subject: Re: win32ada coverage Reply-To: no to spamers (No@email.given.org) References: <785addc4-95e3-48d6-ba9f-e698d26922b5@s12g2000prc.googlegroups.com> <0c1ee36a-67a7-4bf1-9a38-46ea9eae7cf2@s12g2000prc.googlegroups.com> X-Newsreader: IBM NewsReader/2 2.0 Message-ID: <9MXBl.525056$Mh5.400074@bgtnsc04-news.ops.worldnet.att.net> Date: Sun, 05 Apr 2009 05:58:29 GMT NNTP-Posting-Host: 12.64.114.49 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc04-news.ops.worldnet.att.net 1238911109 12.64.114.49 (Sun, 05 Apr 2009 05:58:29 GMT) NNTP-Posting-Date: Sun, 05 Apr 2009 05:58:29 GMT Organization: AT&T Worldnet Xref: g2news1.google.com comp.lang.ada:4441 Date: 2009-04-05T05:58:29+00:00 List-Id: An easy answer is to create a wrapper file "load_image.c". This is needed because LoadImage(A/W) are in some API versions a macro which can not be directly access by Ada. Then use the "pragma Import" statement. Note: Correction may be needed based on your packages and header files. -- -- Insert into you Win32 package -- -- request Ada to automatically include the C object file that -- contains the wrapper for this routine. pragma Linker_Options ( "load_image.o" ) ; function LoadImage ( HINSTANCE hinst ; LPCTSTR lpszName ; UINT uType ; int cxDesired ; int cyDesired ; UINT fuLoad ) return HANDLE ; pragma Import ( C, LoadImage, "LoadImage" ) ; ... /* * load_image.c -- LoadImage wrapper */ #include HANDLE LoadImage ( HINSTANCE hinst, LPCTSTR lpszName, UINT uType, int cxDesired, int cyDesired, UINT fuLoad ); { #ifdef UNICODE return LoadImageW ( hinst, lpszName, uType, cxDesired, cyDesired, fuLoad ) ; #else return LoadImageA ( hinst, lpszName, uType, cxDesired, cyDesired, fuLoad ) ; #endif // !UNICODE } In <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? > >-Hang > >Jerry van Dijk wrote: >> a...@anon.org (anon) writes: >> > Win32Ada provides only a subset of common routines. Version 3.0 was cre= >ated >> > back in 1999, so any additional routines that was added in XP or Vista = >must >> > be added to the package or Imported into your program. >> >> Although SetWindowRgn is indeed missing from from Win32Ada (it was added = >with >> Windows 2000), LoadImage is an alias for either LoadImageA or LoadImageW, >> depending on whether you are in unicode mode or not. >> >> -- >> -- =A0Jerry van Dijk >> -- =A0Leiden, Holland >> -- >> -- =A0The early bird may get the worm, but the second mouse gets the chee= >se!!